mirror of
https://github.com/cc65/cc65.git
synced 2024-07-29 12:29:11 +00:00
Adjusted IRQ handler for new callirq semantics
git-svn-id: svn://svn.cc65.org/cc65/trunk@3498 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
bb92697e31
commit
107ead3211
@ -353,7 +353,7 @@ IRQ: lda #$0F
|
|||||||
ldy #ACIA::STATUS
|
ldy #ACIA::STATUS
|
||||||
lda (acia),y ; Check ACIA status for receive interrupt
|
lda (acia),y ; Check ACIA status for receive interrupt
|
||||||
and #$08
|
and #$08
|
||||||
beq @L9 ; Jump if no ACIA interrupt
|
beq @L10 ; Jump if no ACIA interrupt
|
||||||
ldy #ACIA::DATA
|
ldy #ACIA::DATA
|
||||||
lda (acia),y ; Get byte from ACIA
|
lda (acia),y ; Get byte from ACIA
|
||||||
ldx RecvFreeCnt ; Check if we have free space left
|
ldx RecvFreeCnt ; Check if we have free space left
|
||||||
@ -371,6 +371,7 @@ IRQ: lda #$0F
|
|||||||
ldy #ACIA::CMD
|
ldy #ACIA::CMD
|
||||||
sta (acia),y
|
sta (acia),y
|
||||||
sta Stopped
|
sta Stopped
|
||||||
|
sec ; Interrupt handled
|
||||||
|
|
||||||
; Done, switch back to the execution segment
|
; Done, switch back to the execution segment
|
||||||
|
|
||||||
@ -378,6 +379,13 @@ IRQ: lda #$0F
|
|||||||
sta IndReg
|
sta IndReg
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
; No ACIA interrupt
|
||||||
|
|
||||||
|
@L10: clc ; Interrupt not handled
|
||||||
|
lda ExecReg
|
||||||
|
sta IndReg
|
||||||
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; Try to send a byte. Internal routine. A = TryHard
|
; Try to send a byte. Internal routine. A = TryHard
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ IRQ: lda #$0F
|
|||||||
ldy #ACIA::STATUS
|
ldy #ACIA::STATUS
|
||||||
lda (acia),y ; Check ACIA status for receive interrupt
|
lda (acia),y ; Check ACIA status for receive interrupt
|
||||||
and #$08
|
and #$08
|
||||||
beq @L9 ; Jump if no ACIA interrupt
|
beq @L10 ; Jump if no ACIA interrupt
|
||||||
ldy #ACIA::DATA
|
ldy #ACIA::DATA
|
||||||
lda (acia),y ; Get byte from ACIA
|
lda (acia),y ; Get byte from ACIA
|
||||||
ldx RecvFreeCnt ; Check if we have free space left
|
ldx RecvFreeCnt ; Check if we have free space left
|
||||||
@ -371,6 +371,7 @@ IRQ: lda #$0F
|
|||||||
ldy #ACIA::CMD
|
ldy #ACIA::CMD
|
||||||
sta (acia),y
|
sta (acia),y
|
||||||
sta Stopped
|
sta Stopped
|
||||||
|
sec ; Interrupt handled
|
||||||
|
|
||||||
; Done, switch back to the execution segment
|
; Done, switch back to the execution segment
|
||||||
|
|
||||||
@ -378,6 +379,13 @@ IRQ: lda #$0F
|
|||||||
sta IndReg
|
sta IndReg
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
; No ACIA interrupt
|
||||||
|
|
||||||
|
@L10: clc ; Interrupt not handled
|
||||||
|
lda ExecReg
|
||||||
|
sta IndReg
|
||||||
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; Try to send a byte. Internal routine. A = TryHard
|
; Try to send a byte. Internal routine. A = TryHard
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
|||||||
|
|
||||||
IRQ: lda ACIA_STATUS ; Check ACIA status for receive interrupt
|
IRQ: lda ACIA_STATUS ; Check ACIA status for receive interrupt
|
||||||
and #$08
|
and #$08
|
||||||
beq @L9 ; Jump if no ACIA interrupt
|
beq @L10 ; Jump if no ACIA interrupt
|
||||||
lda ACIA_DATA ; Get byte from ACIA
|
lda ACIA_DATA ; Get byte from ACIA
|
||||||
ldx RecvFreeCnt ; Check if we have free space left
|
ldx RecvFreeCnt ; Check if we have free space left
|
||||||
beq @L1 ; Jump if no space in receive buffer
|
beq @L1 ; Jump if no space in receive buffer
|
||||||
@ -362,13 +362,19 @@ IRQ: lda ACIA_STATUS ; Check ACIA status for receive interrupt
|
|||||||
dec RecvFreeCnt ; Decrement free space counter
|
dec RecvFreeCnt ; Decrement free space counter
|
||||||
cpx #33 ; Check for buffer space low
|
cpx #33 ; Check for buffer space low
|
||||||
bcc @L1 ; Assert flow control if buffer space low
|
bcc @L1 ; Assert flow control if buffer space low
|
||||||
@L9: rts
|
rts ; Return with carry set (interrupt handled)
|
||||||
|
|
||||||
; Assert flow control if buffer space too low
|
; Assert flow control if buffer space too low
|
||||||
|
|
||||||
@L1: lda RtsOff
|
@L1: lda RtsOff
|
||||||
sta ACIA_CMD
|
sta ACIA_CMD
|
||||||
sta Stopped
|
sta Stopped
|
||||||
|
sec ; Interrupt handled
|
||||||
|
rts
|
||||||
|
|
||||||
|
; No ACIA interrupt
|
||||||
|
|
||||||
|
@L10: clc ; Interrupt not handled
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user