a stack based virtual machine. the ultimate goal is to be able to convert some kind of bytecode (probably jvm) to this language and have it run. simple program that adds 5 and 5 to the stack and then adds them. 1 5 1 5 2 0 the zero at the end is fully necessary, as it tells the virtual machine to halt running then. exercise: try running this program, but don't put in a zero. watch the pc variable climb higher and higher. there are no instructions at those points, so the emulator just takes in nothing. now, try putting a zero at the start. see how the pc variable only goes up to 2? that's because you stopped the program early, but the virtual machine increments that counter before evaluating any instructions. planned features: an assembly language for the vm planned instructions: CALL, RET instructions: 0 = HALT, stops the program 1 = PUSH, takes the next value in Code (list) and adds it to Stack 2 = ADD, pops the top two values on the stack, adds them and adds that to the stack. 3 = SUB, the same as two, but subtraction. 4 = MUL, multiplication 5 = DIV, division 6 = POP, takes the top stack item and discards it 7 = DUP, duplicates the top item on the stack 8 = SWAP, exchanges the top 2 values from the stack 9 = STORE, files away into memory 10 = LOAD, loads from memory 11 = JMP, jumps to a PC 13 = AND, and gate. pops two values and if they're both 1, proceeds. 14 = OR, and but either one can be one for a success 15 = NOT gate, pops from the stack and inverts the number 16 = NOR gate, only works if both inputs are 0 17 = NAND, the opposite of AND 18 = XOR, only outputs true if only one input is true
v0.0.1 - may 6th 2026 - the initial release. there's probably a bug i don't know of, but oh well. anyways, this isn't all that good since you have to write instructions manually v0.0.2 - may 11th 2026 - added a ton more instructions. notes: this CPU takes in garbage. it's designed to do that. you can put any non-reserved number in the instructions, and it'll just move on from that this also probably doesn't follow best design patterns for... obvious reasons. it's kinda simple to write programs in the language