Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: xavicardona AT rocketmail DOT com, djgpp AT delorie DOT com Date: Thu, 11 Jun 1998 14:22:18 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: z80 to 386 In-reply-to: <357D73EA.73E0@rocketmail.com> Precedence: bulk Xavi Cardona 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