Date: Sun, 14 Sep 1997 18:02:08 +0300 (IDT) From: Eli Zaretskii To: "John M. Aldrich" cc: djgpp AT delorie DOT com Subject: Re: Help me about Djgpp In-Reply-To: <341345BE.22A8@cs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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 dosmemput(ScreenBuf,64000,0xA0000); Nate Eldredge eldredge AT ap DOT net