loops - Marie simulator looping when not meant to after storing inputs -
i have written basic marie code multiplying 2 numbers, x , y. built without first 6 lines , assign x , y decimals test program realized need allow user input numbers. when step through or run it asks input, stores x, asks input, stores y , goes asking input, ie. input x. , 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 1 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
it because multiply subroutine line name/variable has operand 0 when line 8, needs dec 8 work :)
Comments
Post a Comment