Hardware Reference
In-Depth Information
Label
Operations
Comments
Main1
PC = PC + 1; fetch; goto (MBR)
MBR holds opcode; get next byte; dispatch
nop1
goto Main1
Do nothing
iadd1
MAR = SP = SP
1; rd
Read in next-to-top word on stack
iadd2
H = TOS
H = top of stack
iadd3
MDR = TOS = MDR + H; wr; goto Main1
Add top two words; write to top of stack
isub1
MAR = SP = SP
1; rd
Read in next-to-top word on stack
isub2
H = TOS
H = top of stack
isub3
MDR = TOS = MDR
H; wr; goto Main1
Do subtraction; write to top of stack
iand1
MAR = SP = SP 1; rd
Read in next-to-top word on stack
iand2
H = TOS
H = top of stack
iand3
MDR= TOS=MDR AND H; wr; goto Main1 Do AND; write to new top of stack
ior1
MAR = SP = SP 1; rd
Read in next-to-top word on stack
ior2
H = TOS
H = top of stack
ior3
MDR = TOS = MDR OR H; wr; goto Main1 Do OR; write to new top of stack
dup1
MAR = SP = SP + 1
Increment SP and copy to MAR
dup2
MDR = TOS; wr; goto Main1
Write new stack word
pop1
MAR = SP = SP 1; rd
Read in next-to-top word on stack
pop2
Wait for new TOS to be read from memory
pop3
TOS = MDR; goto Main1
Copy new word to TOS
swap1
MAR = SP 1; rd
Set MAR to SP 1; read 2nd word from stack
swap2
MAR = SP
Set MAR to top word
swap3
H = MDR; wr
Save TOS in H; write 2nd word to top of stack
swap4
MDR = TOS
Copy old TOS to MDR
swap5
MAR = SP 1; wr
Set MAR to SP 1; write as 2nd word on stack
swap6
TOS = H; goto Main1
Update TOS
bipush1
SP = MAR = SP + 1
MBR = the byte to push onto stack
bipush2
PC = PC + 1; fetch
Increment PC, fetch next opcode
bipush3
MDR = TOS = MBR; wr; goto Main1
Sign-extend constant and push on stack
iload1
H = LV
MBR contains index; copy LV to H
iload2
MAR = MBRU + H; rd
MAR = address of local variable to push
iload3
MAR = SP = SP + 1
SP points to new top of stack; prepare write
iload4
PC = PC + 1; fetch; wr
Inc PC; get next opcode; write top of stack
iload5
TOS = MDR; goto Main1
Update TOS
istore1
H = LV
MBR contains index; copy LV to H
istore2
MAR = MBRU + H
MAR = address of local variable to store into
istore3
MDR = TOS; wr
Copy TOS to MDR; write word
istore4
SP = MAR = SP 1; rd
Read in next-to-top word on stack
istore5
PC = PC + 1; fetch
Increment PC; fetch next opcode
istore6
TOS = MDR; goto Main1
Update TOS
wide1
PC = PC+ 1; fetch;
Fetch operand byte or next opcode
wide2
goto (MBR OR 0x100)
Multiway branch with high bit set
wide iload1
PC = PC + 1; fetch
MBR contains 1st index byte; fetch 2nd
wide iload2
H = MBRU << 8
H = 1st index byte shifted left 8 bits
wide iload3
H = MBRU OR H
H = 16-bit index of local variable
wide iload4 MAR = LV + H; rd; goto iload3
MAR = address of local variable to push
wide istore1 PC = PC + 1; fetch
MBR contains 1st index byte; fetch 2nd
wide istore2 H = MBRU << 8
H = 1st index byte shifted left 8 bits
wide istore3 H = MBRU OR H
H = 16-bit index of local variable
wide istore4 MAR = LV + H; goto istore3
MAR = address of local variable to store into
ldc w1
PC = PC + 1; fetch
MBR contains 1st index byte; fetch 2nd
ldc w2
H = MBRU << 8
H = 1st index byte << 8
ldc w3
H = MBRU OR H
H = 16-bit index into constant pool
ldc w4
MAR=H+CPP; rd; goto iload3
MAR = address of constant in pool
Search WWH ::




Custom Search