diff --git a/main.c b/main.c index 1e2affc..682cf84 100644 --- a/main.c +++ b/main.c @@ -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 Written by Erick Ahmed, 2022 */ @@ -25,4 +25,24 @@ enum { R_COUNT }; -uint16_t reg[R_COUNT]; \ No newline at end of file +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 +};