Mail Archives: djgpp/1997/07/08/13:12:52
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 -