Added a os_upper_case function

This commit is contained in:
2025-10-30 22:57:31 +00:00
parent 0b9014d846
commit d83871e161
7 changed files with 193 additions and 83 deletions

View File

@@ -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