Mail Archives: djgpp/1997/04/16/22:54:41
> >I've been tring to make a simple inline asm block to copy my virtual
> >screen (virt[64000]) to 0xa000 (using near pointers... I've called
> ^^^^^^
> In DJGPP video memory is stored at 0xA0000.
Please don't make statements like this without adding that it's at
*physical* address 0xa0000. You can't just create a pointer like
this:
char *screen = (char *)(0xa0000);
It won't work because DJGPP uses virtual memory. If you use
<sys/farptr.h>, you can use 0xa0000 as the offset to the conventional
memory segment. If you use <sys/nearptr.h>, you have to add the
offset of the start of conventional memory to 0xa0000 before it will
work.
If you just use 0xa0000, there's a good chance you'll corrupt your own
program if your program is bigger than 640K in executable size.
The FAQ has more info about this in section 10.2.
- Raw text -