Skip to content

Aurimukstis1/Python-VirtualMachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-study of CPU, RAM and Kernel operations.
In simple terms, it's a very basic "Virtual machine"
It can execute simple custom bytecode, write to memory, read from memory, execute simple functions, read/write registers, do simple math.
All memory lives on stack, no heap implementation (yet)
Working Frame/Page allocation for processes.

python-vm-diagram
Opcode Instruction Operands
0x00 HALT halt
0x01 MOVE regX, immediate
0x02 ADD regX, regY
0x03 PUSH regX
0x04 POP regX
0x05 SET immediate
0x06 CALL addr
0x07 RET -
0x08 MOVR regX, regY
0x10 SYS regX
Cpu Code Meaning
0x00 Halt
0xAA Protection error
0xBB Invalid register
0xCC Unknown opcode
0xDD Unknown syscall
0xD0-7 Execute syscall
0xFF Success
Kernel Code Meaning
0x00 exit
0xA0 console out

About

Simple pseudo-vm written in Python 3.14

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages