home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_10 / 8n10103c < prev    next >
Text File  |  1990-08-20  |  984b  |  19 lines

  1.  
  2.             asm("    push  es");         /* save es */
  3.             asm("    mov   ax, 034h");   /* use Phar Lap LDT to access real */
  4.             asm("    mov   es, ax");
  5.             dx = 0x3CE;                  /* EGA graphics address register */
  6.             ebx= 655360 + ((y*colx+x) >> 3); /* memory position of pixel */
  7.        asm(ebx, "    mov   cl, byte ptr es:[ebx]"); /* load EGA registers */
  8.             ax = color << 8; 
  9.     asm(dx, ax, "    out   dx, ax");     /* set color */
  10.             ax = 0x0F01;
  11.     asm(dx, ax, "    out   dx, ax");     /* enable */
  12.             ax = 0x0003; /* 0x00 = replace, 0x10 OR, 0x18 XOR, 0x08 AND */
  13.     asm(dx, ax, "    out   dx, ax");     /* pixel write mode */
  14.             ax = ((0x80 >> (x % 8)) << 8 ) + 8; 
  15.     asm(dx, ax, "    out   dx, ax");     /* bit mask (8 pixels/byte) */
  16.        asm(ebx, "    mov   byte ptr es:[ebx], 255"); /* write EGA registers */
  17.             asm("    pop   es");         /* restore es */
  18.  
  19.