Marie Simulator Problem

Hi, so I have a problem working with assembly code. My task is to write a simple program that takes 2 inputs x and y. If x is greater that y, then the two are to be divided and the quotient displayed. If y is greater than x, then the two are to be multiplied and the product displayed. I have the multiplication side and division side done, and I can find out if x or y is great just by subtracting and then having a skipcond, however I don't understand how to properly skip loops and could use some help getting it working.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 ORG 100
Input
Store x
Input
Store y
Load x
Subt y
SkipCond 000 //skip if result is less than 0
loop, LOAD x // this is the division loop
Subt y
Store x
Load z
Add one
Store z
Load x
SkipCond 400
Jump Loop
SkipCond 400
Loop, Load x // this is the multiplication loop
Add z
Store z
Load y
Subt one
Store y
SkipCond 400
Jump Loop
Load z 
Output
HALT
x, Dec 0
y, Dec 0
z, Dec 0
one, Dec 1
Topic archived. No new replies allowed.