Mail Archives: djgpp/2000/11/06/02:15:35
On Sun, 5 Nov 2000, Danny Byers wrote:
> getc.asm --------------------------------------------
> .MODEL SMALL
> EXTRN _PrintInfo:PROC
> .STACK 100H
I think ".MODEL SMALL" and ".STACK 100H" might be a cause of your
trouble. Also, don't you need a .386 directive, to make the code
32-bit?
> BEGIN:
> push BP
> mov BP,SP
> mov AX,[BP+4]
> call _PrintInfo
You are calling PrintInfo without pushing its argument onto the
stack. What's more serious, PrintInfo calls `printf', which needs
vast amounts of stack space. You also don't preserve registers that
GCC-generated code assumes to be loaded with certain values; see
section 17.4 of the DJGPP FAQ list.
> Any idea as to why I am getting a GPF error with this code? Is it a problem
> related to Protected Mode??
Probably. But you didn't post the full crash message printed when
your program GPFaults, so it is very hard to tell.
You might consider running the program under a debugger, to see where
exactly does it crash, and what is the machine instruction that causes
the crash. That might give you a clue.
- Raw text -