www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/03/21:20:47

From: Andrew Kesterson <Andrew__k_ AT geocities DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Inline asm problem
Date: Wed, 03 Feb 1999 20:15:16 -0600
Organization: Computer Programmer, Freelance
Lines: 22
Message-ID: <36B902B4.7F00@geocities.com>
NNTP-Posting-Host: pm2-sgf-4.dialnet.net
Mime-Version: 1.0
X-Trace: ns2.dialnet.net 918094689 12913 (None) 208.223.16.132
X-Complaints-To: news AT news DOT dialnet DOT net
X-Mailer: Mozilla 3.01 (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In my code, I have the following inline ASM:

__asm__("pushl %%eax\n
         movl %%eip, %0\n
         popl %%eax"
    :
    : "a" ((*StackPtr))
    : );

where StackPtr is an unsigned long which points to the stack of a
program (this is part of the kernel code for an OS I am writing as an
experiment).
I cannot seem to figure out why it will not pass StackPtr. It will not
pass anything else, either. I'm positive I had StackPtr in the right
spot, as the 2nd : is the place for output operands. I am pretty sure %0
is correct, but just to be sure I changed it to %1 and even %2. still
nothing.
	Every time I compile this code, no matter how I have it arranged, it
gives me a parse error. I've checked the DJGPP faq's, the documentation,
EVERYTHING that I could find (including repeated trips to the info
page), but nothing is seeming to work. What in the bloody **** am I
doing wrong?

- Raw text -


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