BASIC Interpreter from MikeOS is functioning

This commit is contained in:
2026-01-20 18:38:51 +00:00
parent e0809f84dc
commit 0f6f8f33f6
22 changed files with 4677 additions and 96 deletions

View File

@@ -7,10 +7,10 @@ os_read_input:
hlt
jmp os_read_input
.key_pressed:
mov ah, 10h
int 16h
ret
.key_pressed:
mov ah, 10h
int 16h
ret
; -------------------------------------------
@@ -18,60 +18,73 @@ os_display_input:
pusha
mov cx, [prompt_length]
.loop:
call .check_key_pressed
.loop:
call .check_key_pressed
jmp .loop
jmp .loop
.check_key_pressed:
call os_read_input
.check_key_pressed:
call os_read_input
cmp al, 08h
je .backspace
cmp al, 08h
je .backspace
cmp al, 0Dh
je .enter_key
cmp al, 0Dh
je .enter_key
cmp al, 1Bh
je .esc_key
cmp al, 1Bh
je .esc_key
cmp cx, 0
jb .check_key_pressed
cmp cx, 0
jb .check_key_pressed
call .print_current_input
dec cx
jmp .check_key_pressed
call .print_current_input
dec cx
jmp .check_key_pressed
.esc_key:
call power_reboot
.esc_key:
call power_reboot
.enter_key:
mov al, 0
stosb
popa
call os_read_cli
.enter_key:
mov al, 0
stosb
popa
call os_read_cli
.backspace:
call .move_cursor_back ; then .move_cursor_back
call .loop ; Else .loop
.backspace:
call .move_cursor_back ; then .move_cursor_back
call .loop ; Else .loop
.move_cursor_back:
mov ah, 0Eh
.move_cursor_back:
mov ah, 0Eh
mov al, 08h
int 10h
mov al, 20h
int 10h
mov al, 08h
int 10h
mov al, 08h
int 10h
mov al, 20h
int 10h
mov al, 08h
int 10h
dec di
jmp os_display_input
dec di
jmp os_display_input
.print_current_input:
stosb
.print_current_input:
stosb
mov ah, 0Eh
int 10h
mov ah, 0Eh
int 10h
ret
keyboard_get_cursor_pos: ;TODO
ret
keyboard_wait_for_key: ;TODO
ret
keyboard_show_cursor:
ret
keyboard_hide_cursor:
ret
keyboard_move_cursor:
ret
keyboard_check_key:
ret