monitor-z80: Record entry SP
authorWill Sowerbutts <will@sowerbutts.com>
Sun, 22 Feb 2015 23:50:27 +0000 (23:50 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Wed, 25 Feb 2015 23:43:52 +0000 (23:43 +0000)
Kernel/lib/monitor-z80.s

index 57d2e27..2503947 100644 (file)
@@ -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: