create LC-3 instruction set opcodes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
TVM is a LC-3 based virtual machine used for educational purposes
|
TVM is a virtual machine for LC-3 based operating systems and it used for educational purposes.
|
||||||
Open-source software under MIT License
|
Open-source software under MIT License
|
||||||
Written by Erick Ahmed, 2022
|
Written by Erick Ahmed, 2022
|
||||||
*/
|
*/
|
||||||
@@ -25,4 +25,24 @@ enum {
|
|||||||
R_COUNT
|
R_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
uint16_t reg[R_COUNT];
|
uint16_t reg[R_COUNT];
|
||||||
|
|
||||||
|
/* Creating LC-3 instruction set opcodes */
|
||||||
|
enum {
|
||||||
|
OP_BR = 0, // branch
|
||||||
|
OP_ADD, // add
|
||||||
|
OP_LD, // load
|
||||||
|
OP_ST, // store
|
||||||
|
OP_JSR, // jump register
|
||||||
|
OP_AND, // bitwise add
|
||||||
|
OP_LDR, // load register
|
||||||
|
OP_STR, // store register
|
||||||
|
OP_RTI, // unused opcode
|
||||||
|
OP_NOT, // bitwise not
|
||||||
|
OP_LDI, // indirect load
|
||||||
|
OP_STI, // indirect store
|
||||||
|
OP_JMP, // jump
|
||||||
|
OP_RES, // reserved opcode
|
||||||
|
OP_LEA, // load effective address
|
||||||
|
OP_TRAP, // execute trap
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user