1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +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:
cuz 2005-05-05 10:00:17 +00:00
parent bb92697e31
commit 107ead3211
3 changed files with 26 additions and 4 deletions

View File

@ -353,7 +353,7 @@ IRQ: lda #$0F
ldy #ACIA::STATUS
lda (acia),y ; Check ACIA status for receive interrupt
and #$08
beq @L9 ; Jump if no ACIA interrupt
beq @L10 ; Jump if no ACIA interrupt
ldy #ACIA::DATA
lda (acia),y ; Get byte from ACIA
ldx RecvFreeCnt ; Check if we have free space left
@ -371,6 +371,7 @@ IRQ: lda #$0F
ldy #ACIA::CMD
sta (acia),y
sta Stopped
sec ; Interrupt handled
; Done, switch back to the execution segment
@ -378,6 +379,13 @@ IRQ: lda #$0F
sta IndReg
rts
; No ACIA interrupt
@L10: clc ; Interrupt not handled
lda ExecReg
sta IndReg
rts
;----------------------------------------------------------------------------
; Try to send a byte. Internal routine. A = TryHard

View File

@ -353,7 +353,7 @@ IRQ: lda #$0F
ldy #ACIA::STATUS
lda (acia),y ; Check ACIA status for receive interrupt
and #$08
beq @L9 ; Jump if no ACIA interrupt
beq @L10 ; Jump if no ACIA interrupt
ldy #ACIA::DATA
lda (acia),y ; Get byte from ACIA
ldx RecvFreeCnt ; Check if we have free space left
@ -371,6 +371,7 @@ IRQ: lda #$0F
ldy #ACIA::CMD
sta (acia),y
sta Stopped
sec ; Interrupt handled
; Done, switch back to the execution segment
@ -378,6 +379,13 @@ IRQ: lda #$0F
sta IndReg
rts
; No ACIA interrupt
@L10: clc ; Interrupt not handled
lda ExecReg
sta IndReg
rts
;----------------------------------------------------------------------------
; Try to send a byte. Internal routine. A = TryHard

View File

@ -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
and #$08
beq @L9 ; Jump if no ACIA interrupt
beq @L10 ; Jump if no ACIA interrupt
lda ACIA_DATA ; Get byte from ACIA
ldx RecvFreeCnt ; Check if we have free space left
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
cpx #33 ; Check for 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
@L1: lda RtsOff
sta ACIA_CMD
sta Stopped
sec ; Interrupt handled
rts
; No ACIA interrupt
@L10: clc ; Interrupt not handled
rts
;----------------------------------------------------------------------------