mirror of
https://github.com/cc65/cc65.git
synced 2024-07-10 23:29:05 +00:00
Carry is clear on IRQ entry
git-svn-id: svn://svn.cc65.org/cc65/trunk@3500 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
3c4cd1fff9
commit
f096dc95ae
@ -344,8 +344,9 @@ IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
|||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
||||||
; registers are already save, no parameters are passed and no return code
|
; registers are already save, no parameters are passed, but the carry flag
|
||||||
; is expected.
|
; is clear on entry. The routine must return with carry set if the interrupt
|
||||||
|
; was handled, otherwise with carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: lda #$0F
|
IRQ: lda #$0F
|
||||||
@ -353,16 +354,16 @@ 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 @L10 ; Jump if no ACIA interrupt
|
beq @L9 ; Jump if no ACIA interrupt (carry still clear)
|
||||||
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
|
||||||
beq @L1 ; Jump if no space in receive buffer
|
beq @L1 ; Jump if no space in receive buffer
|
||||||
ldy RecvTail ; Load buffer pointer
|
ldy RecvTail ; Load buffer pointer
|
||||||
sta RecvBuf,y ; Store received byte in buffer
|
sta RecvBuf,y ; Store received byte in buffer
|
||||||
inc RecvTail ; Increment buffer pointer
|
inc RecvTail ; Increment buffer pointer
|
||||||
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
|
||||||
bcs @L9 ; Assert flow control if buffer space low
|
bcs @L9 ; Assert flow control if buffer space low
|
||||||
|
|
||||||
; Assert flow control if buffer space too low
|
; Assert flow control if buffer space too low
|
||||||
@ -370,7 +371,7 @@ IRQ: lda #$0F
|
|||||||
@L1: lda RtsOff
|
@L1: lda RtsOff
|
||||||
ldy #ACIA::CMD
|
ldy #ACIA::CMD
|
||||||
sta (acia),y
|
sta (acia),y
|
||||||
sta Stopped
|
sta Stopped
|
||||||
sec ; Interrupt handled
|
sec ; Interrupt handled
|
||||||
|
|
||||||
; Done, switch back to the execution segment
|
; Done, switch back to the execution segment
|
||||||
@ -379,13 +380,6 @@ 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
|
||||||
|
|
||||||
|
@ -344,8 +344,9 @@ IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
|||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
||||||
; registers are already save, no parameters are passed and no return code
|
; registers are already save, no parameters are passed, but the carry flag
|
||||||
; is expected.
|
; is clear on entry. The routine must return with carry set if the interrupt
|
||||||
|
; was handled, otherwise with carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: lda #$0F
|
IRQ: lda #$0F
|
||||||
@ -353,16 +354,16 @@ 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 @L10 ; Jump if no ACIA interrupt
|
beq @L9 ; Jump if no ACIA interrupt (carry still clear)
|
||||||
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
|
||||||
beq @L1 ; Jump if no space in receive buffer
|
beq @L1 ; Jump if no space in receive buffer
|
||||||
ldy RecvTail ; Load buffer pointer
|
ldy RecvTail ; Load buffer pointer
|
||||||
sta RecvBuf,y ; Store received byte in buffer
|
sta RecvBuf,y ; Store received byte in buffer
|
||||||
inc RecvTail ; Increment buffer pointer
|
inc RecvTail ; Increment buffer pointer
|
||||||
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
|
||||||
bcs @L9 ; Assert flow control if buffer space low
|
bcs @L9 ; Assert flow control if buffer space low
|
||||||
|
|
||||||
; Assert flow control if buffer space too low
|
; Assert flow control if buffer space too low
|
||||||
@ -370,7 +371,7 @@ IRQ: lda #$0F
|
|||||||
@L1: lda RtsOff
|
@L1: lda RtsOff
|
||||||
ldy #ACIA::CMD
|
ldy #ACIA::CMD
|
||||||
sta (acia),y
|
sta (acia),y
|
||||||
sta Stopped
|
sta Stopped
|
||||||
sec ; Interrupt handled
|
sec ; Interrupt handled
|
||||||
|
|
||||||
; Done, switch back to the execution segment
|
; Done, switch back to the execution segment
|
||||||
@ -379,13 +380,6 @@ 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
|
||||||
|
|
||||||
|
@ -346,13 +346,14 @@ IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
|||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
||||||
; registers are already save, no parameters are passed and no return code
|
; registers are already save, no parameters are passed, but the carry flag
|
||||||
; is expected.
|
; is clear on entry. The routine must return with carry set if the interrupt
|
||||||
|
; was handled, otherwise with carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
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 @L10 ; Jump if no ACIA interrupt
|
beq @L9 ; Jump if no ACIA interrupt (carry still clear)
|
||||||
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
|
||||||
@ -370,12 +371,7 @@ IRQ: lda ACIA_STATUS ; Check ACIA status for receive interrupt
|
|||||||
sta ACIA_CMD
|
sta ACIA_CMD
|
||||||
sta Stopped
|
sta Stopped
|
||||||
sec ; Interrupt handled
|
sec ; Interrupt handled
|
||||||
rts
|
@L9: rts
|
||||||
|
|
||||||
; No ACIA interrupt
|
|
||||||
|
|
||||||
@L10: clc ; Interrupt not handled
|
|
||||||
rts
|
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; Try to send a byte. Internal routine. A = TryHard
|
; Try to send a byte. Internal routine. A = TryHard
|
||||||
|
Loading…
Reference in New Issue
Block a user