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:
@@ -1,15 +1,16 @@
|
||||
;
|
||||
; _printf: Basic layer for all printf type functions.
|
||||
;
|
||||
; Ullrich von Bassewitz, 21.10.2000
|
||||
; Ullrich von Bassewitz, 2000-10-21
|
||||
;
|
||||
|
||||
.include "zeropage.inc"
|
||||
|
||||
.export __printf
|
||||
|
||||
.import popax, pushax, pusheax, decsp6, push1, axlong, axulong
|
||||
.import _ltoa, _ultoa
|
||||
.import _strlower, _strlen
|
||||
.importzp sp, ptr1, ptr2, tmp1, regbank, sreg
|
||||
|
||||
.macpack generic
|
||||
|
||||
@@ -750,7 +751,7 @@ HaveArg:
|
||||
.bss
|
||||
|
||||
; Save area for the zero page registers
|
||||
RegSave: .res 6
|
||||
RegSave: .res regbanksize
|
||||
|
||||
; One character argument for OutFunc
|
||||
CharArg: .byte 0
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
|
||||
.include "o65.inc"
|
||||
.include "modload.inc"
|
||||
.include "zeropage.inc"
|
||||
|
||||
.import pushax, pusha0, push0, push1, decax1
|
||||
.import _malloc, _free, _bzero
|
||||
.import __ZP_START__ ; Linker generated
|
||||
.importzp sp, ptr1, tmp1, regbank
|
||||
|
||||
.macpack generic
|
||||
|
||||
@@ -58,7 +58,7 @@ TPtr = regbank+4 ; Pointer to module data for relocation
|
||||
|
||||
; Save areas and error recovery data
|
||||
Stack: .byte 0 ; Old stackpointer
|
||||
RegBankSave: .res 6 ; Save area for register bank
|
||||
RegBankSave: .res regbanksize ; Save area for register bank
|
||||
|
||||
; The header of the o65 file. Since we don't need the first 8 bytes any
|
||||
; longer, once we've checked them, we will overlay them with other data to
|
||||
|
||||
Reference in New Issue
Block a user