www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/08/13:12:52

Date: Tue, 8 Jul 1997 10:11:53 -0700 (PDT)
Message-Id: <199707081711.KAA26906@adit.ap.net>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Djgpp and Asm

John Conner wrote:
>Ok, heres what I'm trying to do.
>
>asm("leal _RAM,%ebp");    /* RAM is a c pointer */
>
>It crashes every time. I get a gpf or stack fault. 
>It works fine if I use esi,edi,ect. Any help?
ebp is the frame pointer in C. It's used to address things on the stack
(args, local variables, etc). Choices you have:
- Tell GCC you trashed it. See the Extended Asm section of the GCC docs.
- Save and restore it yourself.
- Use a different register.

HTH

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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