DescriptionVC3 is a virtual machine like Chip-8 and the successor to VC2, an earlier project of mine.
VC3's improvements over VC2 include:
More versatile instructions. Now, any register can be a source or a destination.
Debugging features. Add breakpoints and record logs!
Saving/loading data and text.
Stability. The program no longer crashes on incorrect register arguments and always ensures memory accesses are in the correct range.
Included with the virtual machine itself are a few demonstration programs and a few subroutines. Subroutine names begin with an underscore and are intended to be copied into other programs.
I'm currently working on developing an operating system for VC3. If this sounds like something you'd be interested in, you can join the development team in this discord server: https://discord.gg/Ek9ByA9
Unlike the other virtual computers, I am pretty confident that there won't be a successor, at least not for a very long time. I wish to support VC3 with new software rather than creating the same programs for VC3 from scratch again with VC4.InstructionsTo load a VC3 program, start the program called --VC3 and select "load from file" and type the name of the program you wish to run.
Complete documentation here: https://drive.google.com/file/d/1XiwDwLBWW2CDCWXqRb11ydeacaqX1FPG/view
BYTEBF and TBF
These are two versions of the same brainfuck interpreter. A program separated from its input by ! is loaded from the clipboard. BYTEBF has 8-bit cells and TBF has 16-bit cells. The upper screen displays output using the _TERMINAL2 subroutine and the lower screen shows the data tape. Press B to refresh the screen once per brainfuck instruction and A to refresh once per brainfuck output.
Displays the contents of the clipboard.
Obligatory "Hello, world!" program, demonstrating use of relocation and the upper display pointer.
It's Conway's game of life. Press A to place cells and B to remove them and Y to start the simulation.
Outputs all primes that can fit in 16-bits, then halts. Demonstrates the _NUM and _TERMINAL2 subroutines.
A simple demo that allows the user to scroll up and down through memory.
A bubble sort algorithm with an output. Sorts the contents of the clipboard and writes it to the output string.
A demo showing off three subroutines: _KEYBOARD, _NUM and _TERMINAL2. Displays the character typed and the unicode character code for it.
A demo showing off just _TERMINAL2 and _KEYBOARD. Writes keyboard input to output and allows deletion and newlines.
A keyboard routine. Call it and it will return the pressed key in register 0. Fun fact: the keyboard is its own lookup table. Try stepping through it with debug mode on to see how this works.
Requires _TERMINAL or _TERMINAL2. Outputs a number in decimal with leading zeroes.
_TERMINAL and _TERMINAL2
These both output a character in a manner similar to a dumbterminal display from the 1960's or 1970's. TERMINAL2 contains speed improvements in the scrolling routine.NotesThis program requires the c-stick or circle pad pro.
If you've written any VC3 programs, please upload them and share the download code here. I would like to see them!