added some comments

This commit is contained in:
zombie maniac 2021-09-15 10:15:54 -04:00
parent 5d56028dee
commit eea117b5a3

View file

@ -7,26 +7,24 @@ section .text
global main global main
main: main:
sub rsp, 8 sub rsp, 8 ;enter
xor rcx, rcx xor rcx, rcx ;we do this to clear rcx incase it had garbage in it before
_loop: _loop:
;do loop things ;do loop things
mov r9, text mov r9, text
add r9, rcx add r9, rcx
;do text checks and modify the text here 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
mov r8b, [r9]
cmp r8b, 90 cmp r8b, 90
ja _endloop ja _endloop
cmp r8b, 65 cmp r8b, 65
jb _endloop jb _endloop
add r8b, 32 add r8b, 32 ;make the letter capital
mov [r9], r8b mov [r9], r8b
_endloop: _endloop:
@ -36,20 +34,10 @@ _endloop:
jle _loop jle _loop
_print:
mov rdi, text mov rdi, text
cld cld
call puts ;this is the put s way of printing a string call puts ;this is the puts way of printing a string
_end: _end:
add rsp, 8 add rsp, 8 ;exit
ret ret
; mov rax, 60 ; exit
; mov edi, 1 ; error 1 dont need the exit anymore beacue libc or somthing
; syscall