BASIC interpreter

This commit is contained in:
deadvey
2026-02-09 20:41:49 +00:00
parent 0f6f8f33f6
commit e4fc63134f
16 changed files with 4501 additions and 4524 deletions

View File

@@ -308,6 +308,7 @@ disk_write_file:
; OUT
; output_buffer: the list (string)
disk_list_contents:
call disk_load_root
pusha
mov si, root_buffer
mov di, output_buffer
@@ -322,38 +323,22 @@ disk_list_contents:
dec cx
cmp cx, 0
jne .space_loop
.file_attribute:
add si, 11d
mov ax, [si+28d]
call string_cast_from_int
push si
mov si, stringified_int
lodsb
.output_file_size_loop:
stosb
lodsb
push si
mov si, read_only
cmp al, 1h
je .add_string
mov si, hidden
cmp al, 2h
je .add_string
mov si, system
cmp al, 4h
je .add_string
mov si, volume
cmp al, 8h
je .add_string
mov si, directory
cmp al, 10h
je .add_string
mov si, archive
cmp al, 20h
je .add_string
.after_file_attributes:
cmp al, 0
jne .output_file_size_loop
.after_fs_loop:
pop si
mov al, 0Ah
stosb
add si, 20d
add si, 20h
lodsb ; +1
dec si ; -1
cmp al, 0 ; You've come to the end of the root entries
@@ -361,13 +346,6 @@ disk_list_contents:
cmp al, 00E5h ; E5h is a marker that the Fat entry is available
je .finish
jmp .loop
.add_string:
.add_string_loop:
lodsb
cmp ax, 00h
je .after_file_attributes
stosb
jmp .add_string_loop
.finish:
mov cx, output_buffer
sub di, cx