Skip to content

Instantly share code, notes, and snippets.

@codekittie
Created November 20, 2020 00:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codekittie/f3f6981cbd3bd4ff1dc85e61a8756521 to your computer and use it in GitHub Desktop.
Save codekittie/f3f6981cbd3bd4ff1dc85e61a8756521 to your computer and use it in GitHub Desktop.
Multiplying 2 numbers in assembly
global _start
section .text
_start:
; multiply two numbers
; we are going to have a loop that lets us loop the amount of times
;that we want to multiply it
mov r8, 0
mov r9, 5
mov r10, 6
loop:
add r8, r10
sub r9, 1
cmp r9, 0
jne loop
mov rax, 60
mov rdi, r8
syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment