Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VMArch

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)   |
+-----------+----------------------+

About

Custom 16-bit Virtual Machine with Bytecode Interpreter. A lightweight VM implementation featuring 16 general-purpose registers, 64KB memory, and a custom instruction set with support for arithmetic, logic, memory operations, and system calls. Designed for executing obfuscated bytecode and CTF challenges.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages