Modified the BASIC interpreter to support comments using #

and sol whitespace support (eg tabs or spaces for indentation)
This commit is contained in:
deadvey
2026-02-26 12:26:46 +00:00
parent 7eea8d0ce1
commit 54d0665456
5 changed files with 53 additions and 22 deletions

View File

@@ -3970,6 +3970,14 @@ get_token:
mov word si, [prog]
lodsb
cmp al, 09h
je .whitespace
cmp al, 20h
je .whitespace
cmp al, '#'
je .comment
cmp al, 10
je .newline
@@ -3990,13 +3998,28 @@ get_token:
jmp get_string_token
.whitespace:
inc word [prog]
jmp get_token
.comment:
inc word [prog] ; Move past first quote (") char
mov word si, [prog]
mov di, token
.loop:
lodsb
cmp al, 0Ah
je .done
inc word [prog]
jmp .loop
.done:
inc word [prog] ; Move past final quote
jmp get_token
.newline:
inc word [prog]
jmp get_token
get_number_token:
mov word si, [prog]
mov di, token
@@ -4273,6 +4296,8 @@ vars_loc:
work_page db 0 ; Page to print to
disp_page db 0 ; Page to display
tab_skip db " ", 0
space_skip db " ", 0
alert_cmd db "ALERT", 0
askfile_cmd db "ASKFILE", 0
break_cmd db "BREAK", 0