This gives us the foundation to do relocation handling by passing the start of user
code its address in IY
; Assumption - fits into a fixed number of whole 256 byte blocks
;
bankfork:
- ld b, #(U_DATA_STASH - PROG_BASE)/256
- ld hl, #PROG_BASE ; base of memory to fork (vectors included)
+ ld b, #(U_DATA_STASH - PROGBASE)/256
+ ld hl, #PROGBASE ; base of memory to fork (vectors included)
bankfork_1:
push bc ; Save our counter and also child offset
push hl
ld (U_DATA__U_INSYS), a
ex de, hl
+
+ ; for the relocation engine - tell it where it is
+ ld iy, PROGLOAD
ei
jp (hl)
U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes.
Z80_TYPE .equ 0
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
; Where is the character font preloaded for us on this box
-VRAM_CH .equ 1
\ No newline at end of file
+VRAM_CH .equ 1
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
; as far as I can tell either is allowed by the spec
Z80_TYPE .equ 1
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
U_DATA_STASH .equ 0xBD00 ; BD00-BFFF
-PROG_BASE .equ 0x0000
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
Z80_TYPE .equ 0
; No standard clock speed for the Mark IV board, but this is a common choice.
USE_FANCY_MONITOR .equ 1 ; disabling this saves around approx 0.5KB
CPU_CLOCK_KHZ .equ 36864 ; 18.432MHz * 2
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes.
Z80_TYPE .equ 0
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
; (18.432MHz) but this made the machine unstable.
USE_FANCY_MONITOR .equ 1 ; disabling this saves around 0.5KB
CPU_CLOCK_KHZ .equ 16000 ; 16MHz is the stock crystal
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes.
Z80_TYPE .equ 0 ; FIXME: check
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
U_DATA_STASH .equ 0x7D00 ; BD00-BFFF
-PROG_BASE .equ 0x0000
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
Z80_TYPE .equ 1
U_DATA_STASH .equ 0x7D00 ; BD00-BFFF
-PROG_BASE .equ 0x0000
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
Z80_TYPE .equ 1
U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes.
Z80_TYPE .equ 0
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
U_DATA_STASH .equ 0xED00 ; ED00-EFFF
-PROG_BASE .equ 0
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
Z80_TYPE .equ 0
Z80_TYPE .equ 0
+
+PROGBASE .equ 0x0000
+PROGLOAD .equ 0x0100
Z80_TYPE .equ 1
-PROG_BASE .equ 0xC000
+PROGBASE .equ 0xC000
+PROGLOAD .equ 0xC000
;
; Ways we may boot