www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/19/14:41:56

Message-ID: <33303C7C.509F@geocities.com>
Date: Wed, 19 Mar 1997 19:20:29 +0000
From: Daryl Cooper <telephone AT geocities DOT com>
Reply-To: Daryl DOT Cooper AT Bigfoot DOT Com
Organization: home
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: GPFs and PAGEFAULTS
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970318201251 DOT 18446D-100000 AT is>

<HTML><BODY>
Eli Zaretskii wrote:&nbsp;

<BLOCKQUOTE TYPE=3DCITE>You will need to post relevant fragments of your
code to get meaningful&nbsp;
<BR>answers.&nbsp; People have no way of guessing what's wrong with your =
code&nbsp;
<BR>without seeing it.&nbsp;
</BLOCKQUOTE>
&nbsp;
<BR>Yeah, Sorry, Here is the code I am using=A0(the main() function and t=
he relevant
memory functions in my header files)&nbsp;

<BLOCKQUOTE TYPE=3DCITE>
<PRE>#define vga 0xa0000

void main()
{
int x,y,c,detail,border;
unsigned char buffer[64000];
unsigned char *virt=3Dbuffer;
unsigned short local;
printf(&quot;protection =3D%i\n&quot;,__djgpp_nearptr_enable());


init();
local=3D_my_ds();
putpixel(50,50,50,local,(long)&amp;virt);
flip(_go32_my_ds(),(long)&amp;virt,_dos_ds,0xa0000);


restore();
}</PRE>
</BLOCKQUOTE>
&nbsp;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D&nbsp;
<BR>&nbsp;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D&nbsp;
<BR>&nbsp;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D&nbsp;

<BLOCKQUOTE TYPE=3DCITE>
<PRE>
void flip(unsigned short sel,unsigned long source,unsigned short dsel,uns=
igned long dest)
{
//***********************************
//***********************************
//**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; FLIP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; **
//** Function to flip a virtual&nbsp;&nbsp;&nbsp; **
//** screen to the real screen&nbsp;&nbsp;&nbsp;&nbsp; **
//***********************************
//***********************************
asm(&quot;
movw %0,%%ax\n
movw %%ax,%%es\n
movl %1,%%edi\n
movw %2,%%ax\n
movw %%ax,%%ds\n
movl %3,%%esi\n
movl $16000,%%ecx\n
rep\n
movsl&quot;: :
&quot;g&quot;(sel),&quot;g&quot;(source),&quot;g&quot;(dsel),&quot;g&quot=
;(dest)
:&quot;ax&quot;,&quot;edi&quot;,&quot;esi&quot;,&quot;ecx&quot;
);
}

void cls(unsigned short sel,unsigned long mem_loc,unsigned char col)
{
//***********************************
//***********************************
//**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; CLS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; **
//** Function to clear screen to&nbsp;&nbsp; **
//** a given colour&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **
//***********************************
//***********************************
asm(&quot;
movw %2,%%ax\n
movw %%ax,%%es\n
movl %1,%%edi\n
movb %0,%%bl\n
movb %%bl,%%bh\n
movw %%bx,%%ax\n
shl $16,%%eax\n
movw %%bx,%%ax\n
movl $16000,%%ecx\n
rep\n
stosl&quot;:
:&quot;g&quot;(col),&quot;g&quot;(mem_loc),&quot;g&quot;(sel)
:&quot;eax&quot;,&quot;bx&quot;,&quot;ecx&quot;
);
}</PRE>
</BLOCKQUOTE>

<BR>

</BODY>
</HTML>

- Raw text -


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