rst_pin = 7 ; reset pin bit number
ior_pin = 1 ; ISA /IOR pin bit number
iow_pin = 0 ; ISA /IOW pin bit number
*= $EF00 ; set this as needed
; write to NIC port CALL write_creg,address,byte
write_creg:
JSR LAB_1C01 ; scan for "," else do syntax error/warm start
JSR LAB_GADB ; get two parameters for POKE or WAIT
STX Port5 ; byte out to data port
LDM #$FF,PDir5 ; data port to output
LDA Port6 ; get current address
AND #$E0 ; clear non address bits
STA Port6 ; save cleared address
LDA Itempl ; get address back
AND #$1F ; mask non address bits
ORA Port6 ; OR in non port bits
STA Port6 ; save address
CLB iow_pin,Port4 ; write bit low
SEB iow_pin,Port4 ; write bit high
RTS
*= $EF20 ; set this as needed
; read from NIC port USR(n) where n is the address
read_creg:
JSR LAB_EVBY ; evaluate byte expression, result in X
LDM #$00,PDir5 ; data port to input
LDA Port6 ; get current address
AND #$E0 ; clear non address bits
STA Port6 ; save address
TXA ; get address
AND #$1F ; mask non address bits
ORA Port6 ; OR in non port bits
STA Port6 ; save address
CLB ior_pin,Port4 ; read bit low
LDY Port5 ; get byte from data port
SEB ior_pin,Port4 ; read bit high
JMP LAB_1FD0 ; convert Y to byte in FAC1 & return
|