Starting writing an ed implementation

This commit is contained in:
deadvey
2026-03-07 20:48:34 +00:00
parent 43d0a020f7
commit 7a9b82d57c
12 changed files with 126 additions and 83 deletions

View File

@@ -0,0 +1,35 @@
; Planned commands:
; i insert
; a append
; l prints lines
; w save to disk
; q quit
ed:
pusha
mov si, ed_welcome
call os_print_string
.main_loop:
mov ax, ed_prompt
mov bx, 40
call keyboard_display_input ; AX = string location, BX = max prompt length
mov si, ed_prompt
jmp .get_token
; Types of tokens:
; Number: eg 123
; Doller (refers to the last line) $
; Comma ,
; Command: eg i
; 123
.get_token:
xor ax,ax
lodsb
call check_is_number
jmp .exit
.exit:
popa
ret
ed_prompt: times 40 db 0
ed_welcome: db "This is ED\n", 0