From: Will Sowerbutts Date: Mon, 2 Feb 2015 23:28:57 +0000 (+0000) Subject: monitor-z80: allow moving to different segments (updates p112, n8vem-mark4) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5f8853ca9b7c7804104e2ece75f0530d98a5a415;p=FUZIX.git monitor-z80: allow moving to different segments (updates p112, n8vem-mark4) --- diff --git a/Kernel/lib/monitor-z80.s b/Kernel/lib/monitor-z80.s index 190a157e..57d2e274 100644 --- a/Kernel/lib/monitor-z80.s +++ b/Kernel/lib/monitor-z80.s @@ -9,11 +9,10 @@ ; I arg1 - input from port address arg1 ; O arg1 arg2 - output arg2 to port address arg1 - .module monitor-z80 .z80 ; exported symbols - .globl _trap_monitor + .globl monitor_entry ; imported symbols .globl inchar @@ -23,10 +22,12 @@ .globl outnewline .globl outstring - .area _COMMONMEM + ; NOTE: no .area declaration -- this file should be + ; .include'd from platform code (see monitor.s in + ; platform-p112 or platform-n8vem-mark4) ; expect to arrive here with return PC on stack -_trap_monitor: di ; turn off pesky interrupts +monitor_entry: di ; turn off pesky interrupts ld hl, #0 add hl, sp ; save SP pop bc ; save PC diff --git a/Kernel/platform-n8vem-mark4/monitor.s b/Kernel/platform-n8vem-mark4/monitor.s index 656d6506..83af254b 100644 --- a/Kernel/platform-n8vem-mark4/monitor.s +++ b/Kernel/platform-n8vem-mark4/monitor.s @@ -1,19 +1,32 @@ ; 2015-01-17 William R Sowerbutts + .module monitor .include "kernel.def" + .globl _trap_monitor + .globl map_kernel -.ifne USE_FANCY_MONITOR +; ----------------------------------------------------------------------------- +.ifne USE_FANCY_MONITOR ; ----------------------------------------------------- + .area _CODE ; actual monitor lives in kernel bank .include "../lib/monitor-z80.s" -.else + + .area _COMMONMEM ; just a stub goes in common memory +_trap_monitor: + di + call map_kernel + jp monitor_entry + + +; ----------------------------------------------------------------------------- +.else ; MICRO MONITOR --------------------------------------------------------- .globl outchar .globl outnewline .globl outhl - .globl _trap_monitor - ; micro monitor - - ; just dumps a few words from the stack + .area _COMMONMEM _trap_monitor: di call outnewline + ; just dump a few words from the stack ld b, #50 stacknext: pop hl call outhl diff --git a/Kernel/platform-p112/monitor.s b/Kernel/platform-p112/monitor.s index 656d6506..83af254b 100644 --- a/Kernel/platform-p112/monitor.s +++ b/Kernel/platform-p112/monitor.s @@ -1,19 +1,32 @@ ; 2015-01-17 William R Sowerbutts + .module monitor .include "kernel.def" + .globl _trap_monitor + .globl map_kernel -.ifne USE_FANCY_MONITOR +; ----------------------------------------------------------------------------- +.ifne USE_FANCY_MONITOR ; ----------------------------------------------------- + .area _CODE ; actual monitor lives in kernel bank .include "../lib/monitor-z80.s" -.else + + .area _COMMONMEM ; just a stub goes in common memory +_trap_monitor: + di + call map_kernel + jp monitor_entry + + +; ----------------------------------------------------------------------------- +.else ; MICRO MONITOR --------------------------------------------------------- .globl outchar .globl outnewline .globl outhl - .globl _trap_monitor - ; micro monitor - - ; just dumps a few words from the stack + .area _COMMONMEM _trap_monitor: di call outnewline + ; just dump a few words from the stack ld b, #50 stacknext: pop hl call outhl