Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section __DATA, __data
- str:
- .asciz "Hello, World!\n"
- len:
- .quad 0x0123456789ABCDEF
- .section __TEXT, __text
- .globl _main
- _main:
- lea str(%rip), %rdi
- call strlen
- mov %rdi, len(%rip)
- mov $0x2000004, %rax
- mov $1, %rdi
- lea str(%rip), %rsi
- mov len(%rip), %rdx
- syscall
- mov $0, %ebx
- mov $0x2000001, %eax
- syscall
- strlen:
- xor %rcx, %rcx
- xor %al, %al
- not %rcx
- cld
- repne scasb
- not %rcx
- dec %rcx
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement