www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/31/21:01:56

Date: Wed, 31 Aug 1994 20:12:29 -0400 (EDT)
From: Kimberley Burchett <OKRA AT max DOT tiac DOT net>
Subject: asm interface
To: DJGPP Mailing List <djgpp AT sun DOT soe DOT clarkson DOT edu>

  'lo there.  What I want to do now is figger out the inline assembler.
I've got a function that I'd like to write most of in C and then the 
inner loop in asm.  The only thing I can't figure out is how to get the 
local variables I use in the function into registers.
  I looked up the "extended asm" (under "gcc" then "C extensions") in
info, and I found almost enough to let me figure it out, but it assumed a
lot of stuff that I didn't know and I gave up after ten pages or so, not
reaching the end.  So, the best way to get across what I want is via an
example. 

void foo(void) {

  int x;

  /* fiddle around in c and stick a value in x */
  /* put x into %eax */
  /* fiddle around in asm */
}

  Once I get the values into the registers, I can take care of everything
else.  Don't worry, I'm pushing and popping and doing everything I need in
case eax is not available at the time.  I'll eventually be loading
pointers and ints into all eax,ebx,ecx,edx,esi, and edi. 
  If anyone can tell me how to do this, I'll kiss you. :)
							Kim

- Raw text -


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