Login
Back to forumSee the full topicGo to last reply

Posted By

Gaia
on 2012-02-23
15:39:24
 Re: Device detecting

Something like this should work:

. 05FF 78 SEI
. 0600 A9 04 LDA #$04 ; set ATN to low
. 0602 05 01 ORA $01
. 0604 85 01 STA $01
. 0606 A2 00 LDX #$00
. 0608 CA DEX
. 0609 D0 FD BNE $0608 ; just wait a little
. 060B 24 01 BIT $01 ; check highest bit of $01 (DATA low)
. 060D 00 BRK
G5FF


Now you'll have the highest bit of SR (status register) set if no serial device is present, and zero in case there is.
Change the BRK to RTS and insert a CLI in case you are using it as a subroutine.



Back to top


Copyright © Plus/4 World Team, 2001-2024