Skip to content

A custom virtual machine implementation with its own instruction set, assembler, and debugging tools

License

Notifications You must be signed in to change notification settings

JacobEsanders/Amethyst-VM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amethyst VM

A virtual machine implementation from scratch, featuring a custom instruction set architecture and runtime environment.

Features

  • Custom 32-bit instruction set architecture
  • Register-based virtual machine
  • Built-in assembler for creating bytecode
  • Memory management with stack and heap
  • Basic I/O operations
  • Debugging and monitoring tools

Architecture

Registers

  • 8 general-purpose registers (R0-R7)
  • Stack pointer (SP)
  • Program counter (PC)
  • Flags register (FLAGS)

Memory Layout

  • Code segment: Stores program instructions
  • Data segment: Stores global variables
  • Stack: Function calls and local variables
  • Heap: Dynamic memory allocation

Instruction Set

  • Arithmetic operations (ADD, SUB, MUL, DIV)
  • Logical operations (AND, OR, XOR, NOT)
  • Memory operations (LOAD, STORE)
  • Control flow (JMP, JEQ, JNE, CALL, RET)
  • I/O operations (PRINT, READ)
  • System operations (HALT, NOP)

Building and Running

# Build the VM
make build

# Run a program
./amethyst-vm program.avm

# Assemble source code
./assembler program.asm -o program.avm

Example Programs

See the examples/ directory for sample programs that demonstrate the VM capabilities.

Development

  • src/ - Source code for the VM implementation
  • examples/ - Example programs
  • tests/ - Test suite
  • docs/ - Documentation

License

MIT License

About

A custom virtual machine implementation with its own instruction set, assembler, and debugging tools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published