Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .type capitalize, @function
- .global capitalize
- capitalize:
- MOV $0, %rdx
- MOV $0, %rcx
- loop:
- MOVB (%rcx, %rdi, 1), %r8b
- CMP $0, %r8b
- JE end
- CMP $('.'), %r8b
- JE check_if_next_is_small_letter
- CMP $('?'), %r8b
- JE check_if_next_is_small_letter
- CMP $('!'), %r8b
- JE check_if_next_is_small_letter
- JMP loop
- check_if_next_is_small_letter:
- MOVB (%rcx, %rdi, 1), %r8b
- CMP $0, %r8b
- JE end
- CMP $' ', %r8b
- JE check_if_next_is_small_letter
- CMP $'\n', %r8b
- JE check_if_next_is_small_letter
- change_char:
- CMP $'a', %r8b
- JL loop
- CMP $'z', %r8b
- JG loop
- SUBB $32, %r8b
- end:
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement