Write a MARIE assembly program to read two different positive numbers from the keyboard and output the smaller number to the screen.
Answer:
The desired MARIE assembly program is given below:
/ program to get x, y from user
/ if x < y print x
/ else if x > y print y
/ else just print x
org
100
input
/ get value for x from user
store X
input
/ get value for y from user
store Y
Test1,
subt
X
/ acc = y - x
skipcond
000
/ if negative then x is bigger, we can skip further tests
jump
Test2
load
Y
/ got here if x bigger, so print y, then done
output
jump
Done
Test2, skipcond
800
/ if positive then y bigger, skip further tests
jump
XYEq / if
here then equal, go to XYeq print section
load
X
/got here if y bigger, print x, then done
output
jump
Done
XYEq,
load
X
/ just print x, then done
output
Done, halt
X,
dec
0
/ default value for x
Y,
dec
0
/ default value for y
(plz give me a thums up...if my answer helped you and if any suggestion plz comment, Yr thums up boost me)
Write a MARIE assembly program to read two different positive numbers from the keyboard and output...
Using the MARIE computer assembly language, write a program that computes the following expression: z ß (a * b) * (c * d). The computer will read in the input values a, b, c, and d from the keyboard, and the final result (z) has to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Each time a multiplication of two numbers is needed, it has to be done using...
Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. The program must be tested...
2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum of both of the integers and all the numbers in between Write a Marie program that determines the largest of a series of positive integers provided by a user. The user will enter a -1 when she is finished. Up to 10 numbers will be provided by the user. Write a Marie program that accepts two positive integers, multiples them by repeated addition, and...
3. Write a program in assembly language that reads a number from the keyboard and displays it on the screen. 4. Write a program in assembly language to ask two digits from the user, store the digits in the EAX and EBX register, respectively, add the values, store the result in a memory location 'res' and finally display the result.
Program : Write a complete C++ program that Input: Read a positive integer from the keyboard (user) with proper prompt text and save it to a variable. The integer have up to five digits. Processing: From the right most digit, extract every digit from the input integer using modular operator %then save the digit to a separate variable. Remove the right most digit from the integer using integer division operator /. Repeat above two steps till all digits have been...
Write a program that inputs up to 100 real numbers from the
keyboard (one at a time). When a number greater than 1.0e9 is input
the keyboard input will stop. Then the following statistic for the
input data will be computed and printed out to the screen.
a) average
b) standard deviation
c) minimum value
d) maximum value
e) range = (maximum-minimum)/2
f) the number of times zero is input
**Note: this is a program in C++**
3) Write a...
Write a MARIE program in assembly to compute the maximum elements of two arrays.
Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the numbers one by one. Assume that all numbers will be in the range 1 to 1000. To terminate the data entry, user will input any negative number. Once the data entry is complete, the program will show four statistics about the list of numbers: (1) Count (2) Minimum value (3) Sum of numbers (4) "Mean/Average" calculation. As...
Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...
Write a ( JAVÅ) program which reads (from the keyboard) numbers (doubles) until a zero is input and computes the maximum and minimum of all the read numbers (excluding the terminating zero). Note: you must allow for negative as well as positive numbers. Hint: look at java.lang.Double.MAX_VALUE and java.lang.Double.MIN_VALUE.