Question: Background: The Mic - 1 simulator package not only contains an IJVM assembler, but also a MAL assembler ( which assembles MAL microcode into object

Background: The Mic-1 simulator package not only contains an IJVM assembler, but also a MAL assembler (which assembles MAL microcode into object code that is then loaded into the control store of the Mic-1 simulator as a microprogram).
Tasks:
Implement in microcode a new ISHR instruction. The ISHR instruction shifts the TOS word 1-bit to the right. This instruction will extend the IJVM instruction set as it is presented in the text.
Implement in microcode a new ISHL instruction. The ISHL instruction shifts the TOS word 1-bit to the left and sets the LSB to 0. This instruction will extend the IJVM instruction set as it is presented in the text.
Implement in microcode a new ISHL16 instruction. The ISHL16 instruction shifts the TOS word 16-bits to the left. This instruction will extend the IJVM instruction set as it is presented in the text.
Create and test an IJVM method, imul(a,b), that will multiply the arguments and place the result on the TOS before executing an IRETURN. This method should use the newly added shift instructions and follow the multiplication algorithm given in class.
Create and test an IJVM method, idiv(a,b), that will divide the arguments and place the result on the TOS before executing an IRETURN. (Here you can assume positive values and your method should produce ab.) This method should use the newly added shift instructions and follow the division algorithm given in class.
Create and test an IJVM method, irem(a,b), that will provide the remainder (or modulus) of ab and place the remainder on the TOS before executing an IRETURN. (Here you can assume positive values for a and b.) This method should use the newly added shift instructions and follow the division algorithm given in class.
Background: The Mic - 1 simulator package not

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 Accounting Questions!