Fix crash with Albireo disk ROM
cas_in_open can corrupt IX. IX must be preserved in asm code otherwise SDCC
is confused.
diff --git a/contiki-cpc/loader/rel.s b/contiki-cpc/loader/rel.s
index be8f085..25234a4 100644
--- a/contiki-cpc/loader/rel.s
+++ b/contiki-cpc/loader/rel.s
@@ -14,6 +14,8 @@
ld h,(hl)
ld l,a
+ push ix
+
;; HL = address of null terminated string
call count_string_length
ld de,#0x0c000 ;; points to unused 2k buffer
@@ -21,6 +23,8 @@
push bc ;; BC = length of file
call 0x0bc7d ;; cas in abandon
pop hl
+
+ pop ix
ret
;;---------------------------------------------------------------------
@@ -49,18 +53,23 @@
ld e,(hl)
dec hl
- push de
ld a,(hl)
dec hl
ld l,(hl)
ld h,a
+ push ix
+
call count_string_length
+ push de
ld de,#0x0c000
call 0x0bc77 ;; cas in open
pop hl ;; load address
call 0x0bc83 ;; cas in direct
call 0x0bc7a ;; cas in close
+
+ pop ix
+
ret
;; void relocate(void *addr,void *base)