Use the new declarations from the zeropage include file. In interrupt handlers

that call C code, we don't need to save the register bank, because the C code
will save it, when needed.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5909 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-11-04 15:23:05 +00:00
parent 673b982b22
commit dc4e898abd
5 changed files with 36 additions and 33 deletions

View File

@@ -6,14 +6,31 @@
;
.export _set_irq, _reset_irq
.interruptor clevel_irq, 1 ; Export as low priority IRQ handler
.interruptor clevel_irq, 1 ; Export as low priority IRQ handler
.import popax
.importzp __ZP_START__
.include "zeropage.inc"
.macpack generic
; ---------------------------------------------------------------------------
.data
irqvec: jmp $00FF ; Patched at runtime
; ---------------------------------------------------------------------------
.bss
irqsp: .res 2
zpsave: .res zpsavespace
; ---------------------------------------------------------------------------
.proc _set_irq
; Keep clevel_irq from being called right now
@@ -59,8 +76,8 @@
rts
; Save our zero page locations
@L1: ldx #zpspace-1
@L2: lda sp,x
@L1: ldx #.sizeof(::zpsave)-1
@L2: lda __ZP_START__,x
sta zpsave,x
dex
bpl @L2
@@ -75,9 +92,9 @@
jsr irqvec
; Copy back our zero page content
ldx #zpspace-1
ldx #.sizeof(::zpsave)-1
@L3: ldy zpsave,x
sty sp,x
sty __ZP_START__,x
dex
bpl @L3
@@ -87,16 +104,3 @@
.endproc
; ---------------------------------------------------------------------------
.data
irqvec: jmp $00FF ; Patched at runtime
; ---------------------------------------------------------------------------
.bss
irqsp: .res 2
zpsave: .res zpspace