Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- buf:
- .byte 0
- .text
- .type fun,@function
- .global fun
- #rdi - pierwszy argument
- #rsi - drugi argument
- #rdx - trzeci argument
- fun:
- MOV %rdi, buf
- nextChar:
- JMP takeFromFirst
- JMP takeFromSecond
- JMP nextChar
- takeFromFirst:
- MOV(%rsi), %al
- CMPB $0, %al
- JE isEndOfSecond
- MOV %al, (%rdi)
- INC %rdi
- INC %rsi
- takeFromSecond:
- MOV(%rdx), %al
- CMPB $0, %al
- JE isEndOfFirst
- MOV %al, (%rdi)
- INC %rdi
- INC %rdx
- isEndOfFirst:
- MOV (%rsi),%al
- CMPB $0, %al
- JE exit
- JMP takeFromFirst
- isEndOfSecond:
- MOV (%rdx),%al
- CMPB $0, %al
- JE exit
- JMP takeFromSecond
- exit:
- MOV buf, %rax
- RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement