fox32rom/monitor/commands/set.asm
jn 34589e501f Make use of data.strz
The ROM is the same before and after this commit:

$ sha256sum fox32-orig.rom fox32.rom
75b169dafbf7dc77cd114f7d05d9c1e8459122bc2bd4178a90aba6fd8dc7372e  fox32-orig.rom
75b169dafbf7dc77cd114f7d05d9c1e8459122bc2bd4178a90aba6fd8dc7372e  fox32.rom


The conversion was performed with a few sed commands and manually
unrolled in monitor/keyboard.asm:

find -name '*.asm' | xargs sed -i -e 's/data.str \("[^"]*"\) data.8 0$/data.strz \1/g'
find -name '*.asm' | xargs sed -i -e 's/data.str \("[^"]*"\) data.8 0 /data.strz \1 /g'
find -name '*.asm' | xargs sed -i -e 's/data.str \("[^"]*"\) data.8 0x00 /data.strz \1 /g'
2023-02-01 23:49:23 +01:00

77 lines
1.2 KiB
NASM

; set command
monitor_shell_set8_command_string: data.strz "set.8"
monitor_shell_set16_command_string: data.strz "set.16"
monitor_shell_set32_command_string: data.strz "set.32"
monitor_shell_set8_command:
call monitor_shell_parse_arguments
; r0: pointer to address string
; r1: pointer to byte string
push r1
mov r1, 16
call string_to_int
mov r10, r0
pop r0
mov r1, 16
call string_to_int
mov r11, r0
; r10: address
; r11: byte
mov.8 [r10], r11
ret
monitor_shell_set16_command:
call monitor_shell_parse_arguments
; r0: pointer to address string
; r1: pointer to half string
push r1
mov r1, 16
call string_to_int
mov r10, r0
pop r0
mov r1, 16
call string_to_int
mov r11, r0
; r10: address
; r11: half
mov.16 [r10], r11
ret
monitor_shell_set32_command:
call monitor_shell_parse_arguments
; r0: pointer to address string
; r1: pointer to word string
push r1
mov r1, 16
call string_to_int
mov r10, r0
pop r0
mov r1, 16
call string_to_int
mov r11, r0
; r10: address
; r11: word
mov [r10], r11
call redraw_monitor_console
ret