Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; rdi - buffer, rsi - string, rdx - symbol to replace, rcx - replacement
- replace_all:
- xor r9, r9
- _loop:
- mov al, byte[rsi + r9]
- cmp al, dl
- jne no_rep
- mov [rdi+r9], cl
- jmp continue
- no_rep:
- mov [rdi+r9], al
- continue:
- inc r9
- cmp al, 0
- je replace_all_exit
- jmp _loop
- replace_all_exit:
- mov rax, rdi
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement