delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/09/00:32:42

Date: Mon, 8 Sep 1997 21:30:45 -0700 (PDT)
Message-Id: <199709090430.VAA27752@adit.ap.net>
Mime-Version: 1.0
To: "Olmeca" <chromes AT hotmail DOT com>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: movmem in DJGPP 2.*

At 05:32  9/4/1997 GMT, Olmeca wrote:
>
>I have a code-fragment, like this:
>vga_addr=(unsigned char * ) 0xA0000000;
>movmem(unsigned char * vga_addr,unsigned char *spr, 64000);
>It works in all C-compilers, except in DJGPP: memory error. (exception
>fault, or something like that...)
>What shall I do?
DJGPP is a protected mode compiler. Addressing conventional memory is not
done like that in protected mode. Try this:
unsigned int vga_offset = 0xA0000; /* a 20-bit address */
movedata(_my_ds(),spr,_dos_ds,vga_offset,64000);

Consider getting a protected mode tutorial (anybody know a good one?)

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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