Mail Archives: djgpp/1996/02/20/12:41:55
Oh man. Somebody help me please....
I'm new to DJGPP and have started using inline assembly within my code.
At the moment, I'm trying to convert my old graphics routines to DJGPP v2 and
am experiencing segment problems when accessing VGA memory at 0xA0000
(mode 13h).
Here's an example of the problem I'm getting...
int DOS_SEG;
void Clear_VGA()
{
DOS_SEG=_go32_conventional_mem_selector();
ASM_LENGTH=16000;
asm("
pushw %es
movw _DOS_SEG,%es
movl $0xA0000,%edi
movw $0,%eax
movw _ASM_LENGTH,%cx
rep
stosl
pop %es
")
}
Okay, if I call this function as a 'one-off' call it works fine. BUT, if I,
say, put it in a loop for some reason (where it is called many times a
second) it refuses to work or simply crashes. This also happens when
calling some of my other functions as well (such as writing pixels direct to
DOS VGA memory).
Is there an easy way to get around this problem ? I know that the _far*
functions are pretty good once compiled, but I want to improve my
assembly !
Any help would be greatly appreciated.
Cheers,
Carrot
- Raw text -