From: Will Sowerbutts Date: Fri, 26 Jun 2015 19:38:28 +0000 (+0100) Subject: monitor-z80: Add Jump command X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a2a8d172d1a57afe6f42233f2115c545dbaa28e7;p=FUZIX.git monitor-z80: Add Jump command --- diff --git a/Kernel/lib/monitor-z80.s b/Kernel/lib/monitor-z80.s index 25039475..f0c0c80f 100644 --- a/Kernel/lib/monitor-z80.s +++ b/Kernel/lib/monitor-z80.s @@ -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