Fixed some bugs with inputs

This commit is contained in:
deadvey
2026-03-08 22:07:21 +00:00
parent 7a9b82d57c
commit 88716c0b64
10 changed files with 199 additions and 32 deletions

View File

@@ -107,7 +107,7 @@ string_join:
; ------------------------------------------------------------------------
; TODO
; Converts a null terminated string to an integer
; Converts a string to an integer
; IN: SI = string location (max 5 chars, up to '65536')
; OUT: AX = number
string_cast_to_int:
@@ -116,8 +116,12 @@ string_cast_to_int:
.loop:
xor ax,ax
lodsb
cmp al, 0
je .finish
cmp al, 30h
jl .finish
cmp al, 39h
jg .finish
sub al, 30h
mov bx, ax
mov ax, 10