I am writing a code to multiply three numbers.
A x B x C = Z You have to input all the initial values. There is a detriment variable as well P. You input in this order A B C Z P... A B & C can be anything. Z is entered as 0 and P as 1. (If you can show me how to just set their initial values that would be great too.)
My real problem is when I go to output Z at the end of the program it either prints a blank space or an x. Any help would be greatly appreciated.
ORG 100
INPUT /USER INPUT VARIABLE
STORE A /STORE IN MEM LOCATION
OUTPUT /SHOW WHAT USER ENTERED
INPUT /USER INPUT VARIABLE
STORE B /VARIABLE B
OUTPUT
INPUT /VARIABLE C
STORE C
OUTPUT
INPUT
STORE Z
OUTPUT
INPUT
STORE P
OUTPUT
LOOP, LOAD Z /START LOOP TO ACCUMULATE A
ADD A
STORE Z
LOAD B
SUBT P /DECRIMENT VARIABLE B
STORE B
SKIPCOND 01 /CHECK IF B = 0
JUMP LOOP /REPEAT LOOP UNTIL B = 0
LOOP2, LOAD Z
ADD A
STORE Z
LOAD C
SUBT P /DECRIMENT C
STORE C
SKIPCOND 01 / CHECK IF C = 0
JUMP LOOP2 /REPEAT LOOP UNTIL C = 0
CLEAR
LOAD A
STORE A
CLEAR
LOAD Z
STORE Z
OUTPUT /DON'T KNOW WHY IT WON'T PRINT
HALT
A, DEC 0
B, DEC 0
C, DEC 0
Z, DEC 0
P, DEC 0