www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/13/13:15:26

Date: Sat, 13 Jan 1996 13:12:22 -0500
From: dj AT delorie DOT com (DJ Delorie)
To: strider7 AT unm DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: good 'ol 13h question

> #include <mem.h>
> #include <conio.h>
> 
> unsigned char far *screen=(unsigned char far *)MK_FP(0xa000, 0);
> 
> void main()
> {
>  setmode(0x13);  /* vga mode 13h */
> 
>  screen[0]=2;    /* put a green pixel at 0,0 */
> 
>  getch();        /* wait... */
> 
>  setmode(0x03);  /* regular vga mode */
> }

Something like this (untested):

#include <dos.h>
#include <dpmi.h>
#include <sys/farptr.h>

main()
{
  __dpmi_regs r;

  r.x.ax = 0x13;
  __dpmi_int(0x10, &r);

  _farpokeb(_dos_ds, 0xa000 + 0, 2);

  getch();

  r.x.ax = 3;
  __dpmi_int(0x10, &r);
}

- Raw text -


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