ED: Gotten l (list) working, need to work more on d (delete) as there's a bug with deleting lines that are not line 1.

This commit is contained in:
deadvey
2026-03-11 21:16:52 +00:00
parent 88716c0b64
commit 245cfa57f3
8 changed files with 234 additions and 84 deletions

View File

@@ -106,39 +106,42 @@ string_join:
ret
; ------------------------------------------------------------------------
; TODO
; Converts a string to an integer
; IN: SI = string location (max 5 chars, up to '65536')
; OUT: AX = number
; OUT: AX = number, DX = length of int string
string_cast_to_int:
pusha
push cx
push bx
push dx
xor cx,cx
.loop:
xor ax,ax
lodsb
cmp al, 30h
; Exit if the character is not a number
cmp al,'0'
jl .finish
cmp al, 39h
cmp al,'9'
jg .finish
sub al, 30h
sub al, '0'
mov bx, ax
mov ax, 10
mul cx ; Multiple the current value by 10
add ax, bx ; Then add the new digit
mov cx, ax
jmp .loop
.finish:
mov [int_tmp], cx
popa
mov ax, [int_tmp]
mov ax,cx
pop dx
pop bx
pop cx
ret
; ------------------------------------------------------------------------
; IN: AX = integer (unsigned)
; OUT: AX -> null-terminated string
string_cast_from_int:
pusha
cld ; Write backwards