Skip to content
Ethan Grammatikidis edited this page Feb 16, 2018 · 10 revisions

Releases

Because I'm not expecting anyone to follow my spammy commit log trying to sift out the few worthwhile releases.

Only releases on this page, not incomplete developments, experiments, or first tries.

User Programs

An interactive stack-based (RPN) integer calculator. Word size is that of SBTCVM itself -- 9 trits. Input is balanced ternary only. I will add decimal later. Output is both balanced ternary and decimal, using the regdump instructions.

It has some uses:

  • Getting used to balanced ternary. I had fun inputting balanced ternary into a precursor of Scal.
  • Getting used to stack operations, as stack dumps and quick help are only a single keypress each. Note though that Scal's terminology was chosen to correspond to keypresses, it is not the same as Forth's.
  • It's an interactive calculator with the exact same limits and characteristics as the machine itself. Sometimes that's useful for programmers.
  • As stock code. It has 2 stack operations routines not found below, swap and duplicate, and effectively tests the stack reset operation.

It's a bit light on operations. I may add some later. I will probably not increase the word size, and definitely won't make it arbitrary precision or floating point. Those are jobs for another calculator, one less useful for checking what SBTCVM's CPU will do. Besides, for the latter two, it'll be a while before the necessary routines are written and tested.

Stock Code

Software stack code with tests and examples. Stack1 routines use reg1 and reg2. Stack1pt routines use reg1 and mempoint. I use stack1 because saving reg2 is slightly easier than saving mempoint, and preserving mempoint can be very useful. Having said that, some stack operations not in these files, such as swap, could be much more efficient with the use of mempoint.

The push and pop routines use SBTCVM's continue instruction to return, which saves pasting them in everywhere. An example is provided of stack-based procedure call and return.

Input balanced ternary by keyboard.

Clone this wiki locally