Skip to content

Instantly share code, notes, and snippets.

@rhamaa
Created March 16, 2019 03:39
Show Gist options
  • Save rhamaa/3b4f1951e2566218b77e666ed674e21d to your computer and use it in GitHub Desktop.
Save rhamaa/3b4f1951e2566218b77e666ed674e21d to your computer and use it in GitHub Desktop.
global _start
section .data
aa db '1234567890a',0
len equ $-aa
section .text
_start:
xor r8,r8;
mov r9,aa;
mov r14,len;
mov r10,1;
loop:
mov rax,[aa+r8];
test r14,r14;
je exit;
lea rsi,[aa+r8+1];
call write;
lea rsi,[aa+r8];
call write;
add r8,2;
; inc r8;
add r9,r8;
dec r14;
jmp loop;
exit:
xor rdi,rdi;
mov rax, 60;
syscall
write:
mov rax, 1;
mov rdi, 1;
; mov rsi, r13;
mov rdx, r10;
syscall
ret
; write2:
; mov rax, 1;
; mov rdi, 1;
; mov rsi, r12;
; mov rdx, r10;
; syscall
; ret
; write:
; mov rax, 1;
; mov rdi, 1;
; mov rsi, r10;
; mov rdx, len
; syscall
; ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment