? Virtual Computer 3 ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
[Help Wanted] SmileBASIC Documentation Project

Virtual Computer 3

Submitted
Updated
Author
bluekrill
Public Key
X33N4JG6
Min. Compat.
New 3DS
Version
1.0
Size
123.2KB
Rating
2 votes
Description VC3 is a virtual machine like Chip-8 and the successor to VC2, an earlier project of mine. VC3's improvements over VC2 include:
  1. More versatile instructions. Now, any register can be a source or a destination.
  2. Debugging features. Add breakpoints and record logs!
  3. Saving/loading data and text.
  4. 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.
Instructions To 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.

CLIP

Displays the contents of the clipboard.

HELLO

Obligatory "Hello, world!" program, demonstrating use of relocation and the upper display pointer.

LIFE

It's Conway's game of life. Press A to place cells and B to remove them and Y to start the simulation.

PRIME

Outputs all primes that can fit in 16-bits, then halts. Demonstrates the _NUM and _TERMINAL2 subroutines.

SCROLL

A simple demo that allows the user to scroll up and down through memory.

SORT

A bubble sort algorithm with an output. Sorts the contents of the clipboard and writes it to the output string.

TRIPLE

A demo showing off three subroutines: _KEYBOARD, _NUM and _TERMINAL2. Displays the character typed and the unicode character code for it.

TWIN

A demo showing off just _TERMINAL2 and _KEYBOARD. Writes keyboard input to output and allows deletion and newlines.

_KEYBOARD

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.

_NUM

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.
Notes This 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!
Categories
Keywords
  • Assembly
  • 16-bit
  • CPU
  • virtual
  • machine
4 Comment(s) Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies What a crazy project... It blows my mind these files actually compile taking user input, and show relatively high-level implementations from low-level code, very impressive! bluekrill bluekrill Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies Haha yes. Virtual computer started as a way for me to understand computers better. It sucked so I made virtual computer 2. That sucked so I made virtual computer 3! What do you mean? Are you referring to the disassembly function in debug mode? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Yeah, well, that and all the test programs! bluekrill bluekrill Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies I plan to release more VC3 assembly programs in the future. I'm currently working on a chip-8 interpreter, so look out for that!