delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/16/22:54:41

Date: Wed, 16 Apr 1997 22:38:09 -0400
Message-Id: <199704170238.WAA01044@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: fremlin AT oncology DOT wisc DOT edu
CC: djgpp AT delorie DOT com
In-reply-to: <75464.fremlin@oncology.wisc.edu>
Subject: Re: new asm question...

> >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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019