home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
packet
/
rli120.ark
/
HDW.MAC
< prev
next >
Wrap
Text File
|
1986-08-12
|
1KB
|
54 lines
; HDW.MAC - 10/27/85 - Deal with hardware ports.
.z80
maclib TNC.LIB
entry pioini,scana,scanb,priora,priorb
external @wait
tncdefs
timdef
pio.ad equ 8 ; PIO data port
pio.as equ 9 ; PIO control port
scan.a equ 1 ; Bit for scan resume COMM port
prio.a equ 2 ; Bit to force priority channel COMM port
scan.b equ 4 ; Bit for scan resume PRINTER port
prio.b equ 8 ; Bit to force priority channel PRINTER port
cseg
; Initialize the PIO.
pioini: ld a,0cfh
out (pio.as),a
ld a,0f0h
out (pio.as),a
ld a,0fh
out (pio.ad),a
ret
scana: ld c,scan.a
jr pulse
scanb: ld c,scan.b
jr pulse
priora: ld c,prio.a
jr pulse
priorb: ld c,prio.b
jr pulse
; Pulse a bit for 2 seconds, using the mask in C.
pulse: in a,(pio.ad)
or c ; Set the bit
out (pio.ad),a
wait 2
in a,(pio.ad)
xor c ; Clear the bit
out (pio.ad),a
ret
end