Mail Archives: djgpp/1999/12/23/04:20:53
On 23 Dec 99, mus.bouayad was found to have commented thusly:
> Hello,I have still problems with using nasm with DJGPP.
> Here is the code :
> [...]
> _CLVga: push ebp
> mov ebp,esp
>
> push dword[VideoRAM]
> pop es
> xor di,di
> xor eax,eax
> mov cx,0x3E80
> rep stosd
>
> mov esp,ebp
> pop ebp
> ret
> [...]
> This routine normally clear the VGA screen that was set up before.
> The program compilation is OK,but when I lunch the application,it
> crashs.Please help me.
> Thanks,
> NB:This asm file is used with C code.
Without really looking or needing to look at your code at this moment, I
suspect your problem is the usual memory protection problem; you don't
mention what you do to gain permission to use that memory. The Intel
80x86 processors allow operating systems to set up memory protection so
that executing applications cannot just willy-nilly do whatever they want
at any address on the machine. These OSes, such as Windows 9x, do take
advantage of these memory protection features for the most part.
Through DPMI, DJGPP programmers make polite requests to access and to
control (e.g., lock) certain areas of memory first before they either read
from or write to (or both) those areas of memory. This interface (one of
the few interrupts you are allowed to call) sets up descriptors properly
for describing the terms (r/o or r/w) and boundaries (base+limit) of
access. You don't need to read the Intel x86 Programmer's Manual to learn
about the details of memory protection (although it's helpful to you).
There is a FAQ plus the DPMI specification which will help you to prepare
your access to memory first, and then you can call your assembly routine.
Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara TURKEY
- Raw text -