Lecture 26
Lecture 26
Lecture26
Logical Description 7 6 5 4 3 2 1 0
Address
0 8-bit output port for D<7> D<6> D<5> D<4> D<3> D<2> D<1> D<0>
DATA
1 8-bit input port for BUSY ACKNLG# PE# SLCT ERROR# Unused Unused Unused
STATUS
2 8-bit output port for Unused Unused DIR IRQEN SLCT IN# INIT# Auto Feed STROBE#
CONTROL XT#
Problem Statement
Unused
Print Line
Command Register LCMD = FFFFF138H
lar r1, Buff ;Set pointer to character buffer.
la r2, 80 ;Initialize character counter and
lar r3, Wait ; branch target.
Wait: ld r0, LSTAT ;Read Ready bit,
brpl r3, r0 ; test, and repeat if not ready.
ld r0, 0(r1) ;Get next character from buffer,
st r0, LOUT ; and send to printer.
addi r1, r1, 4 ;Advance character pointer, and
addi r2, r2, -1 ; count character.
brnz r3, r2 ;If not last, go wait on ready.
la r0, 1 ;Get a print line command,
st r0, LCMD ; and send it to the printer.
• Buff = Pointer to character Buffer.
• Outputs a character
• Advance the buffer pointer
• Decrement the register containing the
number of characters left to print
• Repeat if there are more characters left to
send.