IJVM Register Set


There are 15 registers visible in the computer simulator window. Four of these control the execution of the microprogram and the other 11 form the data path of the CPU.

Microprogram Registers

These four registers control the order in which the microinstructions in the current microprogram are executed:

Microprogram Counter (MPC)

This register stores the address (in the control store) of the next microinstruction.

Microinstruction Register (MIR)

This register stores the current microinstruction whose bits drive the control lines of the CPU. In the simulator, the contents of the MIR are displayed simultaneously in two formats: binary and micro assembly language (mal).

Negative (N)

This one-bit register stores a copy of the sign bit (the high-order bit) of the value generated by the ALU. If the JAMN bit in a microinstruction is set, the N register is used to determine the address of the next microinstruction.

Zero (Z)

This one-bit register is set to 1 if the value generated by the ALU is 0. Otherwise, this register is set to 0. If the JAMZ bit in a microinstruction is set, the Z register is used to determine the address of the next microinstruction.

Data Path Registers

There are 11 registers that can be accessed by a microinstruction. They are listed below in the order in which they appear in the computer simulator window. In most cases, the register names are relevant only when the computer is running the machine language interpreter. A numbered register can drive the B-bus by using the register number (expressed as a 4-bit binary integer) as the B-bus field of a microinstruction.

Memory Address Register (MAR)

Stores the address of the 32-bit word that is being written to or read from memory. This is a write-only register.

Memory Data Register (MDR) - Register 0

The MDR is used to hold the 32-bit word that is being written to or read from memory. When no memory access is being performed, this register can be used as a general register.

Program Counter (PC) - Register 1

When interpreting machine language programs, this register serves as the program counter and holds the address of the next byte in the instruction stream. Otherwise, this register can be used as a general register.

Memory Buffer Register (MBR) - Register 2/3

This register stores a single byte read from the memory cell addressed by PC. When read as register 2, the byte data is treated as a signed integer in the range -128 to 127 (the sign bit of the byte data is extended into the leading 24 bits creating a 32-bit value). When read as register 3, the byte data is treated as an unsigned value in the range 0 to 255 (the leading 24 bits are set to zeroes). This register is a read-only register. When interpreting machine language programs, this register holds the current byte of the instruction stream.

Stack Pointer (SP) - Register 4

When interpreting machine language programs, this register serves as the stack pointer. Otherwise, this register can be used as a general register.

Local Variables (LV) - Register 5

When interpreting machine language programs, this register points to the local variables of the currently executing method. Otherwise, this register can be used as a general register.

Constant Pool Pointer (CPP) - Register 6

When interpreting machine language programs, this register points to the constant pool. Otherwise, this register can be used as a general register.

Top of Stack (TOS) - Register 7

When interpreting machine language programs, this register always contains a copy of the value at the top of the stack. Otherwise, this register can be used as a general register.

Old Program Counter (OPC) - Register 8

When interpreting machine language programs, this register is used to store the old program counter and also as a scratchpad register. Otherwise, this register can be used as a general register.

Hold (H)

This register holds data that is to be supplied to the left (A) input of the arithmetic logic unit. This is the only register that can perform this function.

Arithmetic Logic Unit (ALU)

Technically, the ALU is not a register. However, the result generated by the ALU is displayed as a register in the computer simulator window.

Shifter (SHFT)

There are two possible shift operations. The first shifts the value from the ALU 8 bits to the left with zero fill (a logic shift). The second shifts the value in the ALU one bit to the right with sign extension (arithmetic shift). Sign extension means that the high order bit prior to the shift will be copied into the vacated high order bit position following the shift right. The value displayed in the shifter is the value after the specified shift operation is performed. If there is no shift operation, the value in the shifter will be the same as the value displayed in the ALU.

Editing Register Values

All of the data path registers except the ALU and the shifter can be edited. Use the mouse to click on the register whose value you want to edit. You can use the left and right arrow keys to move around within the register. To change a bit value, move the underline cursor to the bit position and type in a "0" or a "1".

Note: resetting the computer resets the PC, SP, LV, and CPP registers to their default values.