Created
November 25, 2013 20:22
-
-
Save jslvtr/7648192 to your computer and use it in GitHub Desktop.
This SSEM Assembly program multiplies 750 by 2, getting the result 1500.
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
; THIS PROGRAM MULTIPLIES A NUMBER BY 2 | |
; Made by Jose Salvatierra | |
; University of Dundee | |
VAR 0 ; Fill space | |
START: LDN NUM1 ; Copy variable negated | |
SUB NUM1 ; Subtract itself (multiply by 2) | |
STO MYSUM ; Store it in accumulator | |
LDN MYSUM ; Negate the answer (make it positive) | |
STO MYSUM ; Store to variable | |
STP ; Stop the processor | |
NUM1: VAR 750 ; Declare 32-bit variable | |
MYSUM: VAR 0 ; Declare 32-bit variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment