www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/14/14:56:55

Date: Sun, 14 Sep 1997 18:02:08 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "John M. Aldrich" <fighteer AT cs DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Help me about Djgpp
In-Reply-To: <341345BE.22A8@cs.com>
Message-ID: <Pine.SUN.3.91.970914180139.20228F-100000@is>
MIME-Version: 1.0

On Mon, 8 Sep 1997, John M. Aldrich wrote:

> Use the system() function, which under DJGPP 2.01 recognizes internal
> DOS commands and calls command.com to execute them.
> 
> Example:
> 
>   system( "dir" );

If you have a program called `dir.exe' or `dir.com' somewhere on your
PATH, the above command will run it instead of the built-in command of
COMMAND.COM.  So caveat emptor.

If you want to be sure that the built-in command is invoked, say this:

   system ("command.com /c dir");
ts of my code:
>
>void SetUpVirtual()
>{
>  unsigned char *ScreenBuf = (unsigned char*) calloc(64000,1);
>  if(ScreenBuf == NULL)
>  {
>    SetMode(0x3);
>    cout << "not enough memory available, exiting program..";
>    exit(1);
>  }
>}
>
>void Cls(unsigned char Col,unsigned char *Where)
>{
>  memset(Where,Col,64000);
>}
You can't use the standard mem* functions with memory outside your data
space. You will have to use the farptr functions, using a selector of
_dos_ds and an offset of the real-mode VGA address, presumably 0xA0000. I
don't believe there is a library function that does memset with far
pointers. I don't know how to do this in inline asm, but here's a generic,
almost pseudo-code AT&T asm routine to do a clear-screen. It will need some
modification:
pushw %es
# Fill %eax with 4 bytes of color:
movb color,%al
movb %al,%ah
movw %ax,%bx  # Save two bytes of it
rorl %eax,$16
movw %bx,%ax
movw _dos_ds,%es
movl $0xA0000,%edi
movl $16000,%ecx
rep
stosl
popw %es

>
>void Flip()
>{
>  memcpy(vga,ScreenBuf,64000);
>}
>
Try instead:
#include <movedata.h>
dosmemput(ScreenBuf,64000,0xA0000);

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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