Skip to content

Instantly share code, notes, and snippets.

@jslvtr
Created November 25, 2013 20:22
Show Gist options
  • Save jslvtr/7648192 to your computer and use it in GitHub Desktop.
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 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