Mail Archives: djgpp/1998/06/11/09:51:25
Hi Xavi,
I use
*** char asm[30] ={"movb whatever"}; ***
and it assembles Regards Ian.
Xavi Cardona wrote:
>
> Hi!
> 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.
- Raw text -