MARIE Programming Exercises
MARIE Programming Exercises
1) The user must enter two positive integer numbers, X and Y, and the subtraction X-Y must be calculated.
showing the result on screen.
2) Ask for a value X and write a counter down to 1, that is, print X, X-1, … 2, 1.
3) Ask for a value X and write a countdown until reaching 0, that is, print X, X-1, … 2, 1, 0.
4) The user must enter two positive integers, called X and Y. It must be performed
the multiplication X by Y, store the result in a variable called Z and display the result
on screen.
5) Knowing that the instruction 'clear' is coded as 'A' and that its function is to set the value of
AC to 0, and having the following program:
For each value entered, the program returns the sum of all values.
introduced so far.
The user inputs values as long as they do not enter a 0. If the user enters a number
negative, the absolute value will be used for the sum.
8) Marie's instruction: Jump out
a. performs an unconditional jump to the address 800H.
b. perform a jump of the following instruction if AC has a value = 0
c. make an unconditional jump to the instruction that is labeled with exit
d. performs an unconditional jump to the halt instruction
10) Programming languages (C++, Java, Visual Basic,...) are types of language
machine
b. assembler
high level
d. of specific application