Chapter
1
I
System
Calls
Printeroutput
Print Character Function Call
05H
Outputs a character
to
the printer.
If
CONTROL-C is
typed at console input, Interrupt
23H
is executed.
Entry Conditions:
AH
=
05H
DL
=
character
for
printer
Macro
Definition:
print-char macro character
nov dl, character
mov ah,05H
int
21
H
endm
Example:
The following program prints a walking test pattern on the
printer.
It
stops if CONTROL-C is pressed.
line-num db
0
f unc-05H: mov
start-line: mov
add
push
mov
inc
CmP
print-i
t:
print-char bl
11
mov
no-reset:
loop
i
nc
POP
loop
cx
,60
bl,33
b1,line-num
cx,80
cx
bl
b1,126
no-re5et
bl,33
pr
int-i
t
print-char
13
print-char
10
I
ine-num
start-line
cx
;print
66
line5
;first printable
ASCII
;character(')
;to
offset
1
character
;save number-of-line5 counter
;loop counter for line
;THIS FUNCTION
;move
to
next
ASCII
character
;last
printable
ASCII
;character
(3/4)
;not there yet
;start over with
(1)
;print another character
;carriage return
;line feed
;to
offset
1st
char.
of
line
;restore #-of-lines counter
;print another line
37