zombie-core-utils/case.asm

44 lines
731 B
NASM
Raw Normal View History

extern puts
section .data
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
textlength db 76
section .text
global main
main:
2021-09-15 10:15:54 -04:00
sub rsp, 8 ;enter
2021-09-15 10:15:54 -04:00
xor rcx, rcx ;we do this to clear rcx incase it had garbage in it before
_loop:
;do loop things
mov r9, text
add r9, rcx
2021-09-15 10:15:54 -04:00
mov r8b, [r9] ;this block here makes sure that our character is a capital letter and if its not a capital letter do nothing and return
cmp r8b, 90
ja _endloop
cmp r8b, 65
jb _endloop
2021-09-15 10:15:54 -04:00
add r8b, 32 ;make the letter capital
mov [r9], r8b
_endloop:
;end loop
inc rcx
cmp rcx, [textlength]
jle _loop
mov rdi, text
cld
2021-09-15 10:15:54 -04:00
call puts ;this is the puts way of printing a string
_end:
2021-09-15 10:15:54 -04:00
add rsp, 8 ;exit
ret