www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/14/03:30:20

From: you AT somehost DOT somedomain (Herman Schoenfeld)
Newsgroups: comp.os.msdos.djgpp
Subject: Inline assembly in djgpp
Date: 14 May 1998 07:04:17 GMT
Organization: Your Organization
Lines: 18
Message-ID: <6je51h$h46$1@grissom.powerup.com.au>
References: <Pine DOT LNX DOT 3 DOT 96 DOT 980513155828 DOT 650D-100000 AT Vpg16 DOT vpg DOT hu>
NNTP-Posting-Host: ts5148.powerup.com.au
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

How do i do a "byte ptr" in djgpp inline asm?

ie.

mov ax, byte ptr a
asm ("movw ??, %%ax": : "g" (a): "ax");

Is there any possible way to use variable names in inline assembly?

int i=10, j=20;
asm ("movw %_i, %%eax": : "eax");
asm ("movw %_j, %%ebx": : "ebx");

I know that works, however if the above assembly is in a function and 
the variables i,j are declared publically, then it decides to load those 
not the ones declared inside the function. Why doesn't the scope rules 
seem to affect djgpp inline asm? Or, is there a way around this?

- Raw text -


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