MARIE simulator: multiplication of two numbers using addition

jatin picture jatin · Apr 26, 2015 · Viewed 17k times · Source

multiplication of two numbers 6 and 3 by, repeatedly addition of 3 six times,using a loop that will add 3 six times and store the result into accumulator.

Answer

MiguelNunez picture MiguelNunez · Nov 3, 2015
INPUT
STORE x
INPUT
STORE y
loop, LOAD x
ADD multiply
STORE multiply
LOAD y
SUBT one
STORE y
SKIPCOND 400
JUMP loop
LOAD multiply
OUTPUT
HALT
x, Dec 0
y, Dec 0
one, Dec 1
multiply, Dec 0