#include #include #define PRINTER 0x17 //BIOS printer port #define LPT1 0x00 //LPT1, your first printer #define EJECT 0x0c //Eject page printer command void prnstring(char *string); 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(); prnstring("Testing.\r\n"); prnstring("Hey! It works!"); eject(); } void prnstring(char *string) { while(*string) //while there is a character to print prnchar(*string++); //print it and increment } 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); }