Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- s:
- .byte 0
- .type generate_str,@function
- .global generate_str
- #rdi->rsi->rdx->rcx
- generate_str:
- MOV %rdi, s
- CMP $0, %rcx
- JE theSameLetter
- JMP changeLetter
- theSameLetter:
- CMP $0, %rdx
- JE exit
- MOV %rsi, (%rdi)
- INC %rdi
- DEC %rdx
- JMP theSameLetter
- changeLetter
- CMP $0, %rdx
- JE exit
- MOV %rsi, (%rdi)
- INC %rsi
- INC %rdi
- DEC %rdx
- JMP changeLetter
- exit:
- MOV s, %rax
- RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement