delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/11/09:51:25

From: Ian Chapman <ichapman AT mailcity DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: z80 to 386
Date: Thu, 11 Jun 1998 09:23:40 -0400
Organization: Bell Northern Research
Lines: 25
Message-ID: <357FDA5C.A56E038A@mailcity.com>
References: <357D73EA DOT 73E0 AT rocketmail DOT com>
NNTP-Posting-Host: bcarib90.bnr.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019