Memory monitor: WIP LOAD command

This commit is contained in:
Daniele Verducci 2025-02-14 10:47:45 +01:00
parent 9960d81a44
commit 64d57bdb31

View File

@ -37,13 +37,13 @@ MON_COMMAND_SET: DB "SET",0
MON_COMMAND_ZERO: DB "ZERO",0 MON_COMMAND_ZERO: DB "ZERO",0
MON_COMMAND_LOAD: DB "LOAD",0 MON_COMMAND_LOAD: DB "LOAD",0
MON_COMMAND_RUN: DB "RUN",0 MON_COMMAND_RUN: DB "RUN",0
MON_COMMAND_ADB: DB "ADB",0
MON_COMMAND_MEMTEST: DB "MEMTEST",0 MON_COMMAND_MEMTEST: DB "MEMTEST",0
MON_COMMAND_QUIT: DB "QUIT",0 MON_COMMAND_QUIT: DB "QUIT",0
MON_ARG_HEX: DB " 0x",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_MSG_ADB: DB 10,"Waiting for data.",0
MON_ERR_SYNTAX: DB " Syntax error",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_INTRO: DB " Checking memory... ",0
; MON_RAMTEST_RAMSTART: DB " Ram starts at 0x",0 ; MON_RAMTEST_RAMSTART: DB " Ram starts at 0x",0
MON_DUMP_BYTES_LINES: EQU 8 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 ld (hl), 0 ; set byte to 0 in memory
ret 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: monitor_load:
ld bc, MON_COMMAND_LOAD + 1 ; autocomplete command ld bc, MON_COMMAND_LOAD + 1 ; autocomplete command
call Sys_Print 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 jp monitor_main_loop
monitor_run: monitor_run: