Created
November 17, 2020 15:57
-
-
Save ghostdevv/911555b15c349c31a6d0ac473ba2fbf9 to your computer and use it in GitHub Desktop.
Multiplication in Assembly Language (Little Man Computer - http://www.peterhigginson.co.uk/LMC/ )
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
// Get both numbers and store them | |
INP | |
STA NUM | |
INP | |
STA TIMES | |
// Multiplication Loop | |
LOOP LDA TOTAL | |
ADD NUM | |
STA TOTAL | |
LDA TIMES | |
SUB ONE | |
BRZ END | |
STA TIMES | |
BRA LOOP | |
// End loop and output number | |
END LDA TOTAL | |
OUT | |
HLT | |
// Declarations | |
NUM DAT | |
TIMES DAT | |
TOTAL DAT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment