






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Parallel I/O Device Printer
Accessing the Paralle l Port Through BIOS Functions
17H/00H Write a character on entry AH= AL=ASCII code DX=Interface# On exit AH=Status Byte
17H/01H Initialize Printer on entry AH= DX=Interface# On exit AH=Status Byte
17H/02H Get Printer Status on entry AH=02, DX=Interface# On exit AH=Status Byte
#include <dos.h> void interrupt (old)( ); void interrupt ne wfunc ( ); main( ) { old=getvect(0x17); setvect(0x17,newfunc); keep(0,1000); } void interrupt ne wfunc( ) { if (_AH==0) { if ( _AL != „ „ ) (old)(); } }**
#include <dos.h> void interrupt (old)( ); void interrupt newfunc ( ); main() { old=getvect(0x17); setvect(0x17,newfunc); keep(0,1000); } void interrupt newfunc ( ) { if ( _AH == 0 ) { (old)(); _AH=0; (old)(); _AH=0; (old)(); } (old)(); }*
Direct Parallel Port Programming
*unsigned int far * lpt = (unsigned int far ) 0x00400008 ;
unsigned int temp; temp=(lpt); lpt=(lpt + 1);*
*(lpt + 1)=temp;
Direct Parallel Port Programming
Port Registers
Direct Parallel Port Programming
Port Registers
Base +0=Data Port
Base +1=Printer Status
Out of Paper Printer Online Printer is ready for Next Character
Printer is Busy
Printer Control Register =Base + 2
Auto Line Field
IRQ ENABLE initialize
SELECT InLine Turn Computer on line
Direct Parallel Port Programming
Port Registers
Execute Interrupt When ACK=0;