monitor-z80: Add Jump command
authorWill Sowerbutts <will@sowerbutts.com>
Fri, 26 Jun 2015 19:38:28 +0000 (20:38 +0100)
committerWill Sowerbutts <will@sowerbutts.com>
Fri, 26 Jun 2015 19:39:48 +0000 (20:39 +0100)
Kernel/lib/monitor-z80.s

index 2503947..f0c0c80 100644 (file)
@@ -8,6 +8,7 @@
 ;   D arg1 [arg2]  - display memory at address arg1 (to arg2)
 ;   I arg1         - input from port address arg1
 ;   O arg1 arg2    - output arg2 to port address arg1
+;   J arg1         - jump to arg1 and execute code
 
                 .z80
 
@@ -63,6 +64,8 @@ monitor_loop:   call outnewline
                 jp z, inport
                 cp #'O'
                 jp z, outport
+                cp #'J'
+                jp z, jump
 badinput:       ld a, #'?'
                 jp outchar  ; ret back to monitor_loop
 
@@ -127,6 +130,11 @@ hl_eq_de:       ld      a,h
                 cp      e
                 ret
 
+; J addr
+; Jump to addr and execute code
+jump:           jp (hl)
+                ; return address is already on the stack
+
 ; I port
 ; Input from port