Created
November 20, 2020 00:51
-
-
Save codekittie/f3f6981cbd3bd4ff1dc85e61a8756521 to your computer and use it in GitHub Desktop.
Multiplying 2 numbers in assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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