Question: The mic-1 micro-program given in asg3.mal can support 24 Level-2 instructions described in ijvm.conf (20 instructions from the book on page 262 and HALT, ERR,
The mic-1 micro-program given in asg3.mal can support 24 Level-2 instructions described in ijvm.conf (20 instructions from the book on page 262 and HALT, ERR, OUT, and IN). Modify asg3.mal to provide the following two additional Level-2 instructions: IADDD and IXOR. The semantics of these new Level-2 instructions are described in asg3alg.txt. Include OUTBIN (from OutBinNibble.pdf) code in asg3.mal The files relevant to this assignment are given in Project3.zip. Download and expand the zip file in a Windows system. Modify env.bat file and update JDK path (you must have installed JDK 1.7 or later version)& the path of classes.zip
Asg3.mal
The Level-2 instruction formats and semantics are:
IADDD // Integer Double word (64-bit) addition // Pop two double words (top four values) from the stack as // B_Low = m[SP], B_High = m[SP - 1], // A_Low = m[SP - 2], A_High = m[SP - 3] // Perform addition on A_Low and B_Low, and propagate the carry // to the addition result of A_High and B_High // Push the result as // m[SP - 2] = Result_Low // m[SP - 3] = Result_High
IXOR // Integer exclusive OR operation // Pop two words (top two values) from the stack as // Q = m[SP], P = m[SP - 1] // Perform Result = (NOT(P) AND Q) OR (P AND NOT(Q)) // Push the result as // m[SP - 1] = Result OUTBIN // Pop a word from the stack and print the binary values of the word // from MSB to LSB as groups of 4 bits with one space between groups. // e.g. 1111 1111 1111 1111 1111 1111 1111 1111
where m stands for the main memory (one dimensional array).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
