From: Will Sowerbutts Date: Sun, 22 Feb 2015 23:50:27 +0000 (+0000) Subject: monitor-z80: Record entry SP X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=1d4e6fbd0dc9d277971f388cf1ef84849456ed13;p=FUZIX.git monitor-z80: Record entry SP --- diff --git a/Kernel/lib/monitor-z80.s b/Kernel/lib/monitor-z80.s index 57d2e274..25039475 100644 --- a/Kernel/lib/monitor-z80.s +++ b/Kernel/lib/monitor-z80.s @@ -30,6 +30,7 @@ monitor_entry: di ; turn off pesky interrupts ld hl, #0 add hl, sp ; save SP + ld (entry_sp), hl ; save to memory pop bc ; save PC ld sp, #monitor_stack push bc ; orig PC @@ -283,6 +284,9 @@ arg2: .ds 2 linebuffer: .ds 20 linebuffer_end: +; keep a record of the entry SP -- I always forget to write it down! +entry_sp: .ds 2 + ; stack .ds 40 monitor_stack: