Task-Specific Program Code
C-19
Program Examples
Example C–12. Testing and Using Asynchronous Serial Port Delta Interrupts(bitio.asm)
(Continued)
uart:
setc
xf
; toggle xf bit
in
68h,iosr
; Bit i/o check
bit
68h,8
; bit address 7 I/O 3 BIT IS SET?
; required bit place = complement 7 !
bcnd
poll,ntc
; NO then check FOR I/O 2
clrc
tc
out
65h, adtr
; transmit 63h =’c’
splk
#0080h,6bh
; reset delta bit
out
6bh,iosr
; THE DELTA INTERRUPTS WILL BE ALWAYS
; COMING IF THIS IS NOT CLEARED!!!
clrc
xf
; clear xf bit
splk
#20h,ifr
; clear ifr bits
clrc
intm
ret
poll:
in
68h,iosr
bit
68h,9
; bit address 6 I/O 2 bit is set?
bcnd
poll1,ntc
clrc
tc
out
67h, adtr
; if set transmit 69h = ’i’
splk
#0040h,6bh
; reset delta bit
out
6bh,iosr
poll1:
clrc
xf
; clear xf bit
splk
#20h,ifr
; clear ifr bits
clrc
intm
ret
inpt1:
ret
inpt23:
ret
timer:
ret
codtx:
ret
codrx:
ret
.end
; Assembler module end directive
; –optional