Centronics Printer Control - NCR PC4I Technical Reference

Hide thumbs Also See for PC4I:
Table of Contents

Advertisement

PRINTERS AND COMMUNICATIONS
Centronics Printer Control
The short routines in this section illustrate
fundamental programming steps involved in the
initialization of the Centronics interface for
parallel printers, and how to output data.
Initialization of the Centronics printer interface is
essentially as follows:
WAIT1:
MOV
OX,37AH
;Control port.
MDV
AL,ODD01000B ;Set bit to select external
ClJT
OX,AL
MDV
CX,2000
;device [SELECT INPUT).
LOOP WAIT1
;Allow device time to select.
MOV
AL,000011000 ;Reset printer
(INIT).
ClJT
OX,AL
;Here, auto Line feed
is
;disabled.
The following routine prints one character assumed to
be available in AL. Supply a TIMEOUT value suitable
for your printer and a routine (PRTXRDY) for the
eventuality that a timeout situation arises.
MOV
DX,378H
;Data output port.
ClJT
EJX,AL
;Place character
in
output buffer.
INC
ox
;Refer to status port.
MDV
ex,
TIMEClJT
WAIT2:
IN
AL,0X
;Reed status.
TEST
AL,100000000 ;Test BUSY bit.
JNZ
STROBE
;Jump if not busy.
LOOP
WAIT2
;Otherwise Loop •••
JMP
PRTXRDY
; ••• until count exhausted.
STROOE:
INC
DX
;Refer to control port.
MOV
AL,OOOD1101B ;Strobe high.
ClJT
DX,AL
DEC
AL
;Thus resetting Strobe bit (O).
ClJT
DX,AL
;Strobe Low.
4-28

Advertisement

Table of Contents
loading

Table of Contents