Mail Archives: djgpp/1997/09/14/14:56:55
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 -