Question: Q . 4 . Instruction sets [ 2 5 marks ] a ) Write assembly code segments that implement the following high - level statement,

Q.4. Instruction sets [25 marks]
a) Write assembly code segments that implement the following high-level statement, for each of
the architectures shown below, where all variables are in memory locations. [The order of
instructions should be preserved. SUB and DIV commands are available.]
z=a-(b-c)e
a stack architecture
Answer
, load/store architecture
Answer
a 3-address architecture.
Answer
b) Convert the following statement into MiniMIPS assembly instructions, where all variables are in
memory locations. Use f and g from your ID. You are only allowed to use the 20 instructions
covered in class. Assume s is in $t0,a is in $t1,b is in $t2,x is in $t3.
Note that the bne and beq instructions dan't have an immediate operand so you have to
initialize variables of your ID digits to use.
AnswerWrite assembly code segments that implement the following high-level statement, for each of the architectures shown below, where all variables are in memory locations. [The order of instructions should be preserved. SUB and DIV commands are available.]
Q . 4 . Instruction sets [ 2 5 marks ] a ) Write

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!