Added a os_upper_case function
This commit is contained in:
@@ -12,7 +12,7 @@ os_compare_strings:
|
||||
.compare:
|
||||
lodsb
|
||||
scasb ; Compare di to si
|
||||
jne .unequal ; If they are no equal, jump to .unequal
|
||||
jne .unequal ; If they are not equal, jump to .unequal
|
||||
cmp al, 0 ; Check if string is finished
|
||||
je .equal ; If it has, return true
|
||||
jmp .compare ; Finally, repeat
|
||||
@@ -24,3 +24,26 @@ os_compare_strings:
|
||||
.equal:
|
||||
mov cl, 1
|
||||
ret
|
||||
|
||||
|
||||
; Convert a string to all upper case
|
||||
os_upper_case:
|
||||
pusha
|
||||
mov di, si
|
||||
.loop:
|
||||
lodsb
|
||||
inc di
|
||||
cmp al, 0
|
||||
je .finish
|
||||
cmp al, 7Ah
|
||||
jns .loop
|
||||
cmp al, 61h
|
||||
js .loop
|
||||
sub al, 20h
|
||||
dec di
|
||||
stosb
|
||||
jmp .loop
|
||||
.finish:
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user