From 64d57bdb3187efc4b6269011ac99cd5268e194be Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Fri, 14 Feb 2025 10:47:45 +0100 Subject: [PATCH] Memory monitor: WIP LOAD command --- .../software/z80-assembly/os/monitor.asm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pat80-computer/software/z80-assembly/os/monitor.asm b/pat80-computer/software/z80-assembly/os/monitor.asm index 0f71766..2debb92 100644 --- a/pat80-computer/software/z80-assembly/os/monitor.asm +++ b/pat80-computer/software/z80-assembly/os/monitor.asm @@ -37,13 +37,13 @@ MON_COMMAND_SET: DB "SET",0 MON_COMMAND_ZERO: DB "ZERO",0 MON_COMMAND_LOAD: DB "LOAD",0 MON_COMMAND_RUN: DB "RUN",0 -MON_COMMAND_ADB: DB "ADB",0 MON_COMMAND_MEMTEST: DB "MEMTEST",0 MON_COMMAND_QUIT: DB "QUIT",0 MON_ARG_HEX: DB " 0x",0 -MON_HELP: DB 10,"Available commands:\nHELP prints this message\nDUMP [ADDR] shows memory content\nSET [ADDR] sets memory content\nZERO [ADDR] [ADDR] sets all bytes to 0 in the specified range\nLOAD\nRUN [ADDR] executes code starting from ADDR\nADB starts Assembly Deploy Bridge\nMEMTEST checks ram boundaries\nQUIT exits",0 +MON_HELP: DB 10,"Available commands:\nHELP prints this message\nDUMP [ADDR] shows memory content\nSET [ADDR] sets memory content\nZERO [ADDR] [ADDR] sets all bytes to 0 in the specified range\nLOAD [ADDR] loads a program or data from tape at ADDR\nRUN [ADDR] executes code starting from ADDR\nADB starts Assembly Deploy Bridge\nMEMTEST checks ram boundaries\nQUIT exits",0 MON_MSG_ADB: DB 10,"Waiting for data.",0 MON_ERR_SYNTAX: DB " Syntax error",0 +MON_COMMAND_LOAD_PRESSPLAY: DB "Press play on tape",0 ; MON_RAMTEST_INTRO: DB " Checking memory... ",0 ; MON_RAMTEST_RAMSTART: DB " Ram starts at 0x",0 MON_DUMP_BYTES_LINES: EQU 8 @@ -294,10 +294,18 @@ monitor_zero: ; TODO: bugged, doesn't exit cycle ld (hl), 0 ; set byte to 0 in memory ret + +; Asks user for a memory position, then wait for data from tape and place it +; from the specified position on until it receives 4 consecutive 0x00 (EOF) +; @uses b, c, h, l monitor_load: ld bc, MON_COMMAND_LOAD + 1 ; autocomplete command call Sys_Print - ; TODO: When implemented, re-enable interrupts before run application + ; Now read the memory address from the user + call monitor_arg_2byte ; returns the read bytes in hl + ; Ask user to press play + ld bc, MON_COMMAND_LOAD_PRESSPLAY + ; TODO: wait for data jp monitor_main_loop monitor_run: