Task-Specific Program Code
C-22
Example C–14. Using Synchronous Serial Port With Codec Device (ad55.asm)
(Continued)
codtx: splk #0010h, ifr ; clear tx intr flag
clrc intm
ret
codrx: setc xf ; toggle xf bit
in *,sdtr ; Read ADC value
lacc *+,0 ; Make LSB zero
and #0fffeh,0 ; to avoid secondary
sacl 6ah,0 ; request for codec
out 6ah,sdtr ; Send ADC value to DAC
mar *,ar0
banz skip,ar1 ; Check buffer limits
lar ar1,#rxbuf
lar ar0,#size
skip: splk #0008h, ifr ; Clear ifr flag
clrc intm
ret
inpt1: ret
inpt23: ret
timer: ret
uart: ret
.end ; Assembler module end directive
; –optional