Answer to Question #183357 in Algorithms for simisola oluwaseyitan alabi

Question #183357

 Assume variables A, B, C, D, and E are stored in memory locations 100, 101, 102, 103, and 104, respectively. Using any of the sample machine language instructions given in this section, translate the following pseudocode operations into machine language instruction sequences. Have your instruction sequences begin in memory location 50:

(a) Set A to the value of (B x C) – (D x E) (that is A = BC - DE). You can use a MULTIPLY and SUBTRACT command for the multiplication and subtraction, respectively.


(b) Set A to the value of (B + C) – D/E (that is A = B + C – D/E). You can use an ADD and DIVIDE command for the addition and division, respectively.


1
Expert's answer
2021-04-20T16:21:06-0400

"\\& A=100, \\&B= 101, \\&C= 102, \\&D= 103" , "\\& E= 104"

Now,

If we will use MIPS then each instruction will use 32 bit and 4 bytes

So,

a)

"\\$mul(*101x*102)"

"\\$mul (*103x*104)"

"=\\$ sub(\\$mul(*101x*102),\\$mul (*103x*104))"

b)

"\\$add(*B, *C)"

"\\$div(*D,*E)"

"=\\$ sub(\\$add(*B,*C), \\$div(*D,*E))"



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS