Skip to content

Instantly share code, notes, and snippets.

@codekittie
Created December 12, 2020 08:02
Show Gist options
  • Save codekittie/7ded576f323a844b17c3e5ecc7f884c3 to your computer and use it in GitHub Desktop.
Save codekittie/7ded576f323a844b17c3e5ecc7f884c3 to your computer and use it in GitHub Desktop.
asm program to multiple 6 by 5 ~recursively~
global _start
section .text
multiply:
xor rax, rax
cmp rsi, 0
je base_case
dec rsi
call multiply
add rax, rdi
base_case:
ret
_start:
mov rdi, 6
mov rsi, 5
call multiply
push rax
mov rax, 60
mov rdi, [rsp]
syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment