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 =...
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 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)
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.
Using the console32 framework, write a complete assembly language program that computes in EAX the perimeter (2*length + 2*width) of a rectangle where the length and width are in memory doublewords. ASSEMBLY LANGUAGE console 32
Write an assembly language program to do the following, and run it and test it on the lab simulator: Read in integers until a zero is read in. Keep a total of both the quantity and the sum of the negative integers and the positive integers. Once a zero is read in (signifying the end of the input) then: • If there were more positive than negative integers, or an equal number, print out a 0 and the sum of...
Can someone please help me with this problem? We are using CodeWarrior to write this program in assembly language. The array sample contains eight 8-bit signed binary numbers (integers) as shown below. Write a program which stores the negative numbers in the array nelements, computes the sum of the positive numbens to be stored in the variable psum and stores the number of the positive numbers in the variable pnumber. Note that a zero is ther positive nor negative. Your...