z80: define PROGLOAD in the asm side of things, also tidy PROG_BASE to match C PROGBASE
authorAlan Cox <alan@linux.intel.com>
Sun, 25 Jan 2015 15:54:08 +0000 (15:54 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 25 Jan 2015 15:54:08 +0000 (15:54 +0000)
This gives us the foundation to do relocation handling by passing the start of user
code its address in IY

16 files changed:
Kernel/lib/z80fixedbank.s
Kernel/lowlevel-z80.s
Kernel/platform-micropack/kernel.def
Kernel/platform-msx1/kernel.def
Kernel/platform-msx2/kernel.def
Kernel/platform-mtx/kernel.def
Kernel/platform-n8vem-mark4/kernel.def
Kernel/platform-nc100/kernel.def
Kernel/platform-p112/kernel.def
Kernel/platform-pcw8256/kernel.def
Kernel/platform-trs80/kernel.def
Kernel/platform-ubee/kernel.def
Kernel/platform-z80pack-lite/kernel.def
Kernel/platform-z80pack/kernel.def
Kernel/platform-z80pack32/kernel.def
Kernel/platform-zx128/kernel.def

index ea1c68e..067b7d0 100644 (file)
@@ -278,8 +278,8 @@ _dofork:
 ;      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
index 14a5b39..76a55cd 100644 (file)
@@ -248,6 +248,9 @@ _doexec:
         ld (U_DATA__U_INSYS), a
 
         ex de, hl
+
+       ; for the relocation engine - tell it where it is
+       ld iy, PROGLOAD
         ei
         jp (hl)
 
index 3cb9253..8fe7a39 100644 (file)
@@ -4,3 +4,6 @@ U_DATA                      .equ 0x7D00       ; (this is struct u_data from kern
 U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 Z80_TYPE                   .equ 0
+
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
index ccff40f..676999d 100644 (file)
@@ -11,4 +11,7 @@ Z80_TYPE                  .equ 1
 
 ; 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
index dd2b6e5..97fb7dc 100644 (file)
@@ -6,3 +6,6 @@ U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 ; as far as I can tell either is allowed by the spec
 
 Z80_TYPE                   .equ 1
+
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
index 6ab4982..86af82f 100644 (file)
@@ -5,7 +5,8 @@ U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 U_DATA_STASH               .equ 0xBD00       ; BD00-BFFF
 
-PROG_BASE                  .equ 0x0000
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
 
 Z80_TYPE                   .equ 0
 
index 96be477..720ce1b 100644 (file)
@@ -15,3 +15,6 @@ MARK4_IO_BASE               .equ 0x80
 ; 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
index 6e50804..2b24a77 100644 (file)
@@ -4,3 +4,6 @@ U_DATA                      .equ 0xF000       ; (this is struct u_data from kern
 U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 Z80_TYPE                   .equ 0
+
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
index 4bf522f..2292759 100644 (file)
@@ -15,3 +15,6 @@ Z80_TYPE                  .equ 2
 ; (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
index 67fe1f1..e115c64 100644 (file)
@@ -4,3 +4,6 @@ U_DATA                      .equ 0xF000       ; (this is struct u_data from kern
 U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 Z80_TYPE                   .equ 0            ; FIXME: check
+
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
index 3291d85..3640536 100644 (file)
@@ -5,6 +5,7 @@ U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 U_DATA_STASH               .equ 0x7D00       ; BD00-BFFF
 
-PROG_BASE                  .equ 0x0000
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
 
 Z80_TYPE                   .equ 1
index 04e570c..ba8d4a0 100644 (file)
@@ -5,6 +5,7 @@ U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 U_DATA_STASH               .equ 0x7D00       ; BD00-BFFF
 
-PROG_BASE                  .equ 0x0000
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
 
 Z80_TYPE                   .equ 1
index 6e50804..86b4a53 100644 (file)
@@ -4,3 +4,5 @@ U_DATA                      .equ 0xF000       ; (this is struct u_data from kern
 U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 Z80_TYPE                   .equ 0
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
index e6a5a3c..7bf48f2 100644 (file)
@@ -5,6 +5,7 @@ U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 
 U_DATA_STASH               .equ 0xED00       ; ED00-EFFF
 
-PROG_BASE                  .equ 0
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
 
 Z80_TYPE                   .equ 0
index 9859fe9..668c489 100644 (file)
@@ -8,3 +8,6 @@ U_STASH_LOW                 .equ 0x7D00       ; 7D00-BFFF
 
 
 Z80_TYPE                   .equ 0
+
+PROGBASE                   .equ 0x0000
+PROGLOAD                   .equ 0x0100
index de19e2a..25add17 100644 (file)
@@ -7,7 +7,8 @@ U_DATA_STASH                .equ 0xFD00       ; BD00-BFFF
 
 Z80_TYPE                   .equ 1
 
-PROG_BASE                  .equ 0xC000
+PROGBASE                   .equ 0xC000
+PROGLOAD                   .equ 0xC000
 
 ;
 ; Ways we may boot