WIP: Monitor asm file stub

This commit is contained in:
Daniele Verducci (ZenPenguin) 2020-11-23 08:47:23 +01:00
parent 7e707c1e96
commit 33fd225a0f
3 changed files with 55 additions and 1 deletions

View File

@ -9,7 +9,8 @@ LCD_DATA_REG: EQU IO_0 + 1
LCD_LINES_LEFT: DB 0x80, 0xA8, 0x94, 0xBC ;array defining lcd command codes for the first char of every line
; variables
lcd_cur_x: EQU DRV_VAR_SPACE
LCD_VAR_SPACE: EQU DRV_VAR_SPACE
lcd_cur_x: EQU LCD_VAR_SPACE
lcd_cur_y: EQU lcd_cur_x + 1
; functions

View File

@ -49,6 +49,33 @@ SYSINIT_GREETING:
;include 'driver_keyboard.asm'
include 'driver_arduino_terminal.asm'
; SYSTEM CALLS
; User I/O
; Prints string
; @param BC Pointer to a null-terminated string first character
Print:
call Term_print
ret
; Writes a single character
; @param A Value of character to print
Printc:
call Term_printc
ret
; Reads a single character
; @return A The read character
Readc:
call Term_readc
ret
; Reads a line
; @return BC The pointer to a null-terminated read string
Readline:
call Term_readline
ret
; System initialization
Sysinit:
;call Lcd_init

26
assembly/bios/monitor.asm Normal file
View File

@ -0,0 +1,26 @@
; Pat80 Memory Monitor
; @author Daniele Verducci
;
; Monitor commands (CMD $arg):
; DMP $pos Dumps first 100 bytes of memory starting at $pos
; SET $pos $val Replaces byte at $pos with $val
; LOA $pos $val Loads all the incoming bytes in memory starting from $pos
; RUN $pos Starts executing code from $pos
; CONSTANTS
; All monitor commands are 3 chars long.
MON_COMMAND_DMP: DB "DMP",0 ; null terminated strings
MON_COMMAND_DMP: DB "SET",0
MON_COMMAND_DMP: DB "LOA",0
MON_COMMAND_DMP: DB "RUN",0
Monitor_main:
; Read from command line
ret
; Parses a command
; TODO: This is not very efficient, should be implemented as a tree, but for few commands is ok...
; return A The interpreted command, or 0 if not found
monitor_parse:
ret