Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BITS 64
- section .text
- print64:
- mov r9, -3689348814741910323
- sub rsp, 40
- mov BYTE [rsp+31], 10
- lea rcx, [rsp+30]
- .print64L2:
- mov rax, rdi
- lea r8, [rsp+32]
- mul r9
- mov rax, rdi
- sub r8, rcx
- shr rdx, 3
- lea rsi, [rdx+rdx*4]
- add rsi, rsi
- sub rax, rsi
- add eax, 48
- mov BYTE [rcx], al
- mov rax, rdi
- mov rdi, rdx
- mov rdx, rcx
- sub rcx, 1
- cmp rax, 9
- ja .print64L2
- lea rax, [rsp+32]
- mov edi, 1
- sub rdx, rax
- xor eax, eax
- lea rsi, [rsp+32+rdx]
- mov rdx, r8
- mov rax, 1
- syscall
- add rsp, 40
- ret
- global _start
- _start:
- xor rax, rax
- mov ax, [var_0_0]
- cmp eax, 0
- jne block_0_1
- jmp block_next_0_13
- block_0_1:
- xor rax, rax
- mov ax, [var_0_0]
- mov rdi, rax
- call print64
- jmp block_end_0_13
- block_next_0_13:
- block_end_0_13:
- xor rax, rax
- mov ax, [var_0_5]
- cmp eax, 0
- jne block_0_2
- jmp block_next_0_14
- block_0_2:
- xor rax, rax
- mov ax, [var_0_5]
- mov rdi, rax
- call print64
- jmp block_end_0_14
- block_next_0_14:
- block_end_0_14:
- xor rax, rax
- mov eax, [var_0_9]
- mov rdi, rax
- call print64
- xor rax, rax
- mov ax, 1
- mov [var_0_0], eax
- xor rax, rax
- mov ax, [var_0_0]
- cmp eax, 0
- jne block_0_3
- jmp block_next_0_21
- block_0_3:
- xor rax, rax
- mov ax, [var_0_0]
- mov rdi, rax
- call print64
- jmp block_end_0_21
- block_next_0_21:
- block_end_0_21:
- xor rax, rax
- mov ax, [var_0_5]
- cmp eax, 0
- jne block_0_4
- jmp block_next_0_22
- block_0_4:
- xor rax, rax
- mov ax, [var_0_5]
- mov rdi, rax
- call print64
- jmp block_end_0_22
- block_next_0_22:
- block_end_0_22:
- xor rax, rax
- mov eax, [var_0_9]
- mov rdi, rax
- call print64
- mov rax, 60
- mov rdi, 0
- syscall
- section .data
- var_0_0 dd 0
- var_0_9 dd 123456
- var_0_5 dd 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement