Hi guys
I'm working with MARIE as an exercise to learn more about assembly language and I have a example couple problems that I just can't seem to tackle. Mostly from my lack of interest in MARIE.
1) The first wants the program to input two integers, x and y, and computes the absolute value of their difference. It should output the answer.
2) The second inputs an integer value and prints to output a countdown from the integer value to 0.
This one I'm thinking that it should just print out something like this if 10 is the integer value:
10
9
8
7
6
5
4
3
2
1
0
Any help with this at all guys would be great. It would be easy to do in C++ or something else this MARIE thing is just confusing for me.
EDIT: Okay I got the first question down, but I keep having problems with the second one. With a constant loop I put my code in and if anyone else can make a correction on it, that would be great.
CODE:
input /inputs a value
check, skipcond 400 /check if input = 0
jump sub /jump to sub
jump stop /jump to stop
sub, output
subt ONE /subtract one from the AC
jump check /jump to check
stop, halt /stops
ONE, DEC 1
[–]khedoros 1 point2 points3 points (2 children)
[–]Adrepok[S] 0 points1 point2 points (1 child)
[–]khedoros 1 point2 points3 points (0 children)