Write a MARIE assembly program to read three different positive numbers from the keyboard and output the difference between the largest and smallest numbers to the screen.
The program is as below
org 100 input / get value for x store X input / get value for y store Y input / get value for z store Z
load X
subt Y
skipcond 000
jump L1
load Y
store Big
load X
store Small
jump Next
L1, load X
store Big
load Y
store Small
Next, load Big
subt Z
skipcond 000
jump L2
load Z
store Big
L2, load Small
subt Z
skipcond 800
jump L3
load Z
store Small
L3, load Big
subt Small
output
halt
X, dec 0
Y, dec 0
Z, dec 0
Small, dec 0
Big, dec 0
Get Answers For Free
Most questions answered within 1 hours.