add jump register
This commit is contained in:
@@ -64,7 +64,7 @@ enum opcodes { // [name, value]
|
|||||||
OP_NOT, // bitwise not,
|
OP_NOT, // bitwise not,
|
||||||
OP_LDI, // indirect load, 1010
|
OP_LDI, // indirect load, 1010
|
||||||
OP_STI, // indirect store,
|
OP_STI, // indirect store,
|
||||||
OP_JMP, // jump,
|
OP_JMP, // jump, 1100
|
||||||
OP_RES, // reserved opcode,
|
OP_RES, // reserved opcode,
|
||||||
OP_LEA, // load effective address,
|
OP_LEA, // load effective address,
|
||||||
OP_TRAP, // execute trap,
|
OP_TRAP, // execute trap,
|
||||||
@@ -195,7 +195,12 @@ int main(int argc, const char* argv[]) {
|
|||||||
//{STI};
|
//{STI};
|
||||||
break;
|
break;
|
||||||
case OP_JMP:
|
case OP_JMP:
|
||||||
//{JMP};
|
uint16_t BaseR = (instr >> 6) & 0x7;
|
||||||
|
|
||||||
|
reg[RG_PC] = reg[BaseR];
|
||||||
|
|
||||||
|
update_flags(dr);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case OP_LEA:
|
case OP_LEA:
|
||||||
//{LEA};
|
//{LEA};
|
||||||
|
|||||||
Reference in New Issue
Block a user