Download Source and EXE

(jeff's blog)

Screenshots: Mine

Full-Screen DOS (Running under VMWare):

default colors:

black on white:

Windowed DOS Prompt:

default colors:

black on white:

Theirs:

Source

/*
This program must be compiled using the 16-bit DOS
version of Turbo C, or possibly some other 16-bit
compiler. It displays something like this:

0 1 2 3 4 5 6 7 8 9 A B C D E F
0   ? ? ? ? ? ? • ? ? ? ? ? ? ? ¤
1 ? ? ? ? ¶ § ? ? ? ? ? ? ? ? ? ?
2   ! " # $ % & ' ( ) * + , - . /
3 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
4 @ A B C D E F G H I J K L M N O
5 P Q R S T U V W X Y Z [ \ ] ^ _
6 ` a b c d e f g h i j k l m n o
7 p q r s t u v w x y z { | } ~ ¦
8 Ç ü é â ä à å ç ê ë è ï î ì Ä Å
9 É æ Æ ô ö ò û ù ÿ Ö Ü ¢ £ ¥ P ƒ
A á í ó ú ñ Ñ ª º ¿ ¬ ¬ ½ ¼ ¡ « »
B ¦ ¦ ¦ ¦ ¦ ¦ ¦ + + ¦ ¦ + + + + +
C + - - + - + ¦ ¦ + + - - ¦ - + -
D - - - + + + + + + + + ¦ _ ¦ ¦ ¯
E a ß G p S s µ t F T O d 8 f e n
F = ± = = ( ) ÷ ˜ ° · · v n ² ¦

Except that the real characters of the OEM
character set are displayed.


Placed in public domain by Jeff Robertson, 2003

*/

/* conio is used only to clear the screen.. we do
   everything else directly to memory */
#include <conio.h>

/* included for the MK_FP macro */
#include <dos.h>

/* used only for the putchar() at the end */
#include <stdio.h>

/* where does the screen start in memory ? */
#define SCREEN_START 0xb800

/* how many columns ? */
#define COLS 80

/* how many blank spaces should appear between the chars on each line? */
#define HOR_SPACING 1

/* how many bytes make a character */
/* 2 = 1 for character code + 1 for attribute (not used) */
#define CHAR_BYTES 2

/* macros to calculate offsets into the screen buffer */
#define row(y) ( (y) * COLS * CHAR_BYTES )
#define col(x) ( (x) * (HOR_SPACING+1) * CHAR_BYTES )

/* sets character c at row i and column j of screenbuffer s. */
/* all arguments are only evaulated once. */
#define setchar(s,i,j,c) *( (s) + row(i) + col(j)) = (c)

char hex[] = {"0123456789ABCDEF"};

int main() {
 int i,j,c=0;
 unsigned char far * s = (unsigned char far *) MK_FP( SCREEN_START, 0);
 clrscr();

 /* indices */
 for(i=0; i<16; i++)
    setchar(s, i+1, 0, hex[i] );

 for(j=0; j<16; j++)
    setchar(s, 0, j+1, hex[j] );


 /* character grid */
 for(i=0; i<16; i++)
    for(j=0; j<16; j++)
        setchar(s, i+1, j+1, c++);


  /* so that the DOS prompt doesn't appear over our stuff */
  for(i=0; i<18; i++)
    putchar('\n');

  puts("Press any key...");
  while( !kbhit());

}