Fixed some bugs with inputs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user