Initially,
PC contains the address of the first instruction.
The first instruction itself is in MBR.
First instruction: ILOAD j
| At label Main 1:
PC = PC + 1; fetch; goto(MBR) |
increment the PC to point to the next byte of memory
fetch => get the next byte (j) and place it into MBR. It will be available after the next microinstruction is executed. goto (MBR)=> use the value found in MBR (the opcode for the ILOAD instruction in this case) as the address of the next microcode instruction to execute. |
| At label iload1
H=LV |
Place the pointer to the local variables into register H |
| MAR = MBRU + H; rd | j offset, which is now in the MBR, is added to the base address of
local variables, which is now in H. The result goes into MAR to be
used to access the required value in memory.
Begin read of that location (copy value found to MDR) |
| MAR = SP = SP+1 | increment stack pointer and place the new stack pointer value into MAR also |
| (MDR is now loaded and available)
PC = PC + 1; fetch; wr |
Increment the PC to point to the next byte
Begin to get the next opcode and place it into MBR. It will be available after the next microinstruction. Content of MDR goes to the memory location specified in MAR, which is the current top of stack location |
| TOS = MDR; goto Main1 | The value located at the top of stack is placed into a register for
easy access without going to the stack itself.
Go back to the main routine and begin to interpret the next instruction. |
The microinstruction MAR=SP=SP+1 (first) and PC=PC+1; fetch;wr (second) shown in all detail.
| Next Address | J
M P C |
J
A M N |
J
A M Z |
S
L L 8 |
S
R A 1 |
F
0 |
F
1 |
E
N A |
E
N B |
I
N V A |
I
N C |
H | O
P C |
T
O S |
C
P P |
L
V |
S
P |
P
C |
M
D R |
M
A R |
W
R I T E |
R
E A D |
F
E T C H |
B bus | |||||||||||
| 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 |