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 on MARIE simulator
This is the question that I need help on. I get the input<5> output<9> but im stuck after that. Please help
For the above mentioned output I have used two variables Sum1 and Sum2 for looping. Sum1 adds the first variable by the count of second variable. then the total is added to third variable. Result is your product.
ex: 4*3*5
(4+4+4) =12 ( Sum1 add 4 ,3 times)
(12+12+12+12+12) (Sum2 add 12 5 times) =60(Result)
The code is here:
Input
Store A
Input
Store B
Input
Store C
Load B
Store Count /Set count for B times
Loop1, Load A
Add Sum1
Output /Track process
Store Sum1
Load Count
Subt One
Store Count
Skipcond 800
Jump Count2
Jump Loop1
Count2, Load C
Store Count /Set count for C times
Loop2, Load Sum1
Add Sum2
Store Sum2 /Final Sum2 == Product
Output /Track process
Load Count
Subt One
Store Count
Skipcond 800
Jump End
Jump Loop2
End, Load Sum2
Output
Halt
A, Dec 0
B, Dec 0
C, Dec 0
Sum1, Dec 0
Sum2, Dec 0
Count, Dec 0
One, Dec 1
Can see the output attached in the image below :
Using the MARIE computer assembly language, write a program that computes the following expression: z =...
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...
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...
NEED HELP WITH THIS . Write a MARIE assembly language program that would simulate calling and executing the following C function, as shown below: z = someFunction(a, b); where z, a and b are main( ) program variables, and the values stored in a and b are input by the user. The value stored in z will be output. Did your program execute correctly? This is the code for the function: int someFunction(int x, int y) { return 3 *...
Write a MARIE assembly program to read two different positive numbers from the keyboard and output the smaller number to the screen.
Write MARIE assembly language programs that do the following: Write a program that inputs an integer and prints to output a countdown from the integer to 0. For example, if 7 is input: 7 6 5 4 3 2 1 0
Write a machine language program to input two one-digit numbers ranging from 0 to 4 (using the character input instruction), add them, and then output the single digit sum (using the character output instruction). Execute your program in the PEP/8 simulator. Example Input: 43 (this is the numbers 4 and 3. Remember, this is two ASCII characters when inputted into your program) Output: 7 (ASCII character 55dec)
Four Integer Stats Write an ARM Assembly Language (I will not accept Intel Assembly code) program to prompt the user to enter four integers. Have your program output to the screen the four integers that were entered at the keyboard, along with the following: sum of the four integers, smallest value, largest value, and the average of the four values. You must utilize the scanf function for reading in the user input and the printf function for outputting the results...
Write a MARIE assembly program that accepts one integer input. Use the the number to calculate the factorial. You must use addition not multiplication. Example: 5! = 5x4x3x2x1 Print out the result.
For some reason nobody out there answers this question, Please
please help me with this, Let me know if any further info will be
needed.
Create a MARIE assembly program which inputs two integers, X and Y, computes 3X + 4Y, and outputs the result. Requirements 1. The program must be written in MARIE Assembly Language. 2. It must use a subroutine to perform the multiplications. 3. You do not need to prompt for the input, just use the Input...
PLEASE HELP ASAP Write a 8088 assembly language program to accept input expressions from standard input consisting of an integer, an operator, and another integer and output the value of the expression to standard output. Valid operators are +, -, x and/ for addition, subtraction, multiplication and division respectively.