Mail Archives: djgpp/1998/06/11/13:20:15
Xavi Cardona <xavicardona AT rocketmail DOT com> wrote:
> I'm working on a Z80 to 80386 machine code translator.
> I make the following routine for putting the "movb $0x1,i" in the
> string variable, but it doesn't work. Gcc says "parse error before
> asm".
> As you see, I don't want to execute the movb instruccion. I just want to
> store the machine code of this instruccion on an array.
> main()
> {int i=5;
> char string[30]; /*more space than we really need*/
> string=asm ("movb $0x1,%0"
> :"=g" (i)
> :"g" (i) );
> }
> There is any easy :) way for doing this?
> Thanks in advanced.
You can't do it! What do you really want to do? Convert a Z80 assembler source
code into a 386 assembler source code? or binary to binary?
For the first just use normal strings ( char *string="move $0x1,?"; ) and
replace the ? with the destination register.
For the second you must do much more work because the destination register is
encoded in the bits.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -