www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/18/20:37:20

Sender: nate AT cartsys DOT com
Message-ID: <3602D442.80070FCB@cartsys.com>
Date: Fri, 18 Sep 1998 14:44:34 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Mthimkhulu Molekwa <MMolekwa AT rrs DOT co DOT za>
CC: "'Djgpp List'" <djgpp AT delorie DOT com>
Subject: Re: FW: Inline ASM
References: <01BDE216 DOT FEF3F280 AT mmolekwa DOT rrs DOT co DOT za>

Mthimkhulu Molekwa wrote:

> Correct me if I'm wrong. Should the above code be:
> 
> asm("movw $0x0003, %%ax\n\t"
>        "int $0x10\n\t"
>        : : "%eax");
> 
> ===> replaced "0x0003" by "$0x0003" 

Yes.  The previous code would have fetched the word from address 0x3 in
memory, and loaded it into ax.

>and ";" by "\n\t"

Not necessary.  `as' will accept either as instruction separators. 
(\n\t looks better if you ever need to look at the asm code, however.)
> 
> MK
> ========================================================
> Mthimkhulu Molekwa
> Reutech Systems - Stellenbosch
> Tel: +27 21 880 1150
> Fax: +27 21 880 1153
> Cell: +27 83 454 1230

-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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