16 bit LC-3 inspired VM implementation
Total GPRs : 16
Special Registers : 2
Total opcode : 16
Control flow : jump,conditional jump,function call
System interrupt : VM syscalls(read/write/exit)
Virtual stack management, with push,pop,ret instructions
Used for: MOV,ADD,SUB,AND,OR,NOT,CMP(Register to Register)
15..12 11..8 7 6..4 3..0
+------+-------+-----+-----+-------
| OPC | RD | I=0 | 000 | RS |
+------+-------+-----+-----+-------
Used for: Register + Immediate operations
15..12 11..8 7 6..0
+------+-------+-------+----------+
| OPC | RD | I=1 | IMM7 |
+------+-------+-------+----------+
Used for : Load/Store operations
15..12 11..8 7..4 3..0
+------+-------+------+------+
| OPC | R1 | R2 | OFF4 |
+------+-------+------+------+
Used for : Control Flow/function call
Jump:
15..12 11..0
+---------------+----------------------+
| JMP/CALL | ADDR12 |
+---------------+----------------------+
Conditional Jump:
15..12 11..9 8..0
+------+--------+---------------+
| JCC | COND | OFFSET9 |
+------+--------+---------------+
VM_INT(VM system call):
15……12 11..0
+-----------+----------------------+
|VM_INT| SYS_CODE (12bit) |
+-----------+----------------------+
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|