1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00
cc65/libsrc/vic20/c_readst.s
Greg King 710c6c6f2f Fixed cbm_k_readst() to work around a VIC-20 Kernal bug.
It properly returns the RS-232 device's status.
2021-03-25 15:22:18 -04:00

29 lines
581 B
ArmAsm

;
; 1999-06-03, Ullrich von Bassewitz
; 2021-01-12, Greg King
;
; unsigned char cbm_k_readst (void);
;
; This version works around a bug in VIC-20 Kernal's READST function.
;
.include "vic20.inc"
.include "../cbm/cbm.inc"
.export _cbm_k_readst
_cbm_k_readst:
ldx #>$0000
lda DEVNUM
cmp #CBMDEV_RS232
beq @L1
jmp READST
; Work-around: Read the RS-232 status variable directly.
@L1: lda RSSTAT
stx RSSTAT ; reset the status bits
rts