#include #include #define PRINTER 0x17 //BIOS printer port #define LPT1 0x00 //LPT1, your first printer #define EJECT 0x0c //Eject page printer command void eject(void); void prnchar(char c); void main() { printf("Please ensure that your printer is on and ready to print.\n"); printf("Press Enter:"); getch(); prnchar('T'); //print "Testing" on the printer prnchar('e'); prnchar('s'); prnchar('t'); prnchar('i'); prnchar('n'); prnchar('g'); eject(); //spew out the page } void eject(void) { prnchar(EJECT); } void prnchar(char c) { union REGS regs; regs.h.ah=0x00; //print character function regs.h.al=c; //character to print regs.x.dx=LPT1; //printer port to print to int86(PRINTER,®s,®s); }