Question: Write an assembly program to evaluate the following expression for this CPU. Ignore the remainder part of the division process and assume the multiplication
Write an assembly program to evaluate the following expression for this CPU. Ignore the remainder part of the division process and assume the multiplication result is 16 bit instead of 32 bit. X = ( (a + b) / (a + c)) (100 * a) The instruction set of this processor consists of the following instructions: ADD Ri, Rj, Rk MUL Ri, Rj, Rk DIV Ri, Rj, Rk MOVE Ri, #100 LOAD Ri, M[X] STORE M[X], Ri ; add Rj to Rk and put result in Ri ; multiply Rj by Rk and put result in Ri ; divide Rj by Rk and put result in Ri ; move constant value %23100 in Ri ; load (copy) content of Memory at address X into Ri ; store (copy) Ri into Memory location at address X Note that in the equation above a = M[A]. It represents content of memory location at address A. Same applies for B, C, X.
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
Steps to evaluate the expression xabac100a on the given CPU Load the values of a b and c into registers Add a and b and store the result in a register Add a and c and store the result in a register Di... View full answer
Get step-by-step solutions from verified subject matter experts
