Help in MARIE language

Thread Starter

Jmorin

Joined Oct 5, 2021
1
I have this program that I am trying to make stop if there is a negative number input by the user can someone explain how I could achieve this? This is on MARIE so I am having trouble doing this with such a limited selection of coding options.

start, input
store X
input
store Y


Test1, load Y
subt X
skipcond 000
jump Test2
load X
output
jump start

Test2, skipcond 800
jump XYEq
load Y
output
jump start

XYEq, load X
output
jump start

Done, halt

X, dec 0
Y, dec 0
 

MrChips

Joined Oct 2, 2009
29,226
Welcome to AAC!

You would need a construct that looks somewhat like this:

loop
:
test number
if number is negative go to Done
else go to loop
 
Top