From: Alan Cox Date: Fri, 2 Oct 2015 15:46:35 +0000 (+0100) Subject: z80-banked: update for SDCC 3.5 + patches for banking, fix 0 check X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a75ce0ad6ac2fad3ad09dc8533c6468b63582d09;p=FUZIX.git z80-banked: update for SDCC 3.5 + patches for banking, fix 0 check --- diff --git a/Kernel/lowlevel-z80-banked.s b/Kernel/lowlevel-z80-banked.s index a323d344..1d865058 100644 --- a/Kernel/lowlevel-z80-banked.s +++ b/Kernel/lowlevel-z80-banked.s @@ -383,8 +383,9 @@ interrupt_handler: ; Get onto the IRQ stack ld (istack_switched_sp), sp ld sp, #istack_top - +.ifeq PROGBASE ld a, (0) +.endif call map_save ; @@ -394,9 +395,10 @@ interrupt_handler: ; We need the kernel mapped for the IRQ handling call map_kernel +.ifeq PROGBASE cp #0xC3 call nz, null_pointer_trap - +.endif ; So the kernel can check rapidly for interrupt status ; FIXME: move to the C code ld a, #1 @@ -672,21 +674,22 @@ _in: .include "lowlevel-z80-cmos-banked.s" .endif -; -; These are needed by the experimental SDCC size optimisations -; .area _COMMONMEM - .globl __enter, __enter_s + .globl ___sdcc_enter_ix + .globl ___sdcc_enter_ix_n -__enter: +___sdcc_enter_ix: pop hl ; return address push ix ; save frame pointer ld ix, #0 add ix, sp ; set ix to the stack frame jp (hl) ; and return -__enter_s: +; +; Not used unless experimentally patched sdcc +; +___sdcc_enter_ix_n: pop hl ; return address push ix ; save frame pointer ld ix, #0 @@ -703,9 +706,12 @@ __enter_s: ; ; This must be in common in banked builds ; - .globl __sdcc_call_hl + .globl ___sdcc_call_hl + .globl ___sdcc_call_iy -__sdcc_call_hl: +___sdcc_call_iy: + .byte 0xFD ; IY override and fall through +___sdcc_call_hl: jp (hl) ; @@ -736,6 +742,7 @@ _memset: dec a ret z ; > 1 ? ld d, h + ld e, l inc de dec bc