; 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
.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
; 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
; 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