1

I have written this very basic Marie code for multiplying two numbers, X and Y. I built it without the first 6 lines and would just assign X and Y decimals to test the program but realized I need to allow the user to input the numbers. Now when I step through this or run it it just asks for input, stores X, asks for input, stores Y and then goes back to asking for Input, ie. the input for X. And it does this infinitely..... what?

Multiply_Subroutine, Dec 0
Input
Store X
Input
Store Y

multiply, Dec 0
Load Y
Skipcond 800
Jump end
Load temp
Add X
Store temp
Load Y
Subt One
Store Y
Skipcond 400
Jump multiply
Load temp
Store X
Output X
end, Halt



X, Dec 0
temp, Dec 0
Y, Dec 0
Null, Dec 0
One, Dec 1
Alexander O'Mara
  • 58,688
  • 18
  • 163
  • 171
lopu
  • 175
  • 1
  • 18

1 Answers1

0

It is because your multiply subroutine line name/variable has the operand 0 when it is line 8, it needs to be Dec 8 for it to work :)

lopu
  • 175
  • 1
  • 18