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. 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...
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 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.
Write a C PROGRAM that will read in 10 floating-point numbers from the keyboard and load them into an array. Add up all the values and store the answer in a variable. Find the largest and smallest number in the array. Put each into its own variable. Print to the screen the sum, largest value, and smallest value. Copy the array to a second array in reverse order. Print out the second array. Read in 20 integer numbers, all in...
Write a program to draw this number triangl using MIPS assembly language The number of rows is inputted from keyboard. 6. Write a program to draw this number triangle 1 1〈--|--〉1 The number of rows is inputted from keyboard. 6. Write a program to draw this number triangle 1 1〈--|--〉1 The number of rows is inputted from keyboard.
in C The preceding LML program reads two numbers from the keyboard and determines and prints the larger value. Note the use of the instruction +4107 as a conditional trans- fer of control, much the same as C's if statement. In-Class Tasks Write LML programs that accomplish each of the following tasks: Use a sentinel-controlled loop to read 10 positive integers and compute and print their sum 1. 2. Use a counter-controlled loop to read seven numbers, some positive and...