Back to Publications or Projects

SuperNumbers III

June 1989, Transactor
Indestructible, faster variables for Vic-20, C64 and C128 Basic

The original SuperNumbers was written by John R. Bennett and was published in July 1985 Transactor. (V6, I1.) It gave the C64 a new type of numeric, floating-point variable for BASIC, which were specified by the British pound symbol () followed by the letters A-Z. SuperNumbers were said to be "indestructible" because they were not reset to zero by program RUN, NEW, STOP-RESTORE, a crash or system reset. They were also faster than ordinary variables because they resided at a fixed location (after the SuperNumbers code,) and BASIC didn't have to search its variable storage to find them.

I wanted SuperNumbers for the C128 and VIC-20.

Original artwork by J. Mostacci, Colorized by R. Curcio

A Vic version seemed easy. All I had to do was change the C64 ROM calls to the corresponding Vic ROM locations and change the BASIC "loader" -- the program that POKEd the code into memory -- to store it in a safe location of Vic memory.

However, on reading the code (Transactor always published the assembly listings of programs,) I found that what Transactor's editor had called a feature was actually a bug. Yes, the program would accept more than the 26 alphabetic characters after the pound symbol. Unfortunately, SNs such as 1 or @ would be stored beyond the memory locations set aside for the normal 26 SuperNumbers, possibly corrupting any nearby code.

I also discovered a bit of redundant code in the original listing, which I made into a single subroutine. This gave me room to make the program accept only the letters A-Z without making the new version longer than the original. It also gave me room for the additional overhead the C128 version would require without making that much longer than the original.

My version(s) of SuperNumbers could have more than one set of 26 variables by carefully POKEing the locations that held the start address of where they were stored. By doing this "on the fly," a BASIC program could have Local and Global SuperNumbers. And, as always, I made the Basic Loader able to install the SuperNumbers routine at a location of the user's choice. I called it SuperNumbers III because I included three versions; Vic-20, C128, and (corrected) C64.

SuperNumbers worked by changing the IERROR "hook" in RAM (which normally pointed to the BASIC ROM error handler,) to first see if the error was a syntax error caused by in a statement and if so, whether the next character was a letter. (CHKALPH.) If these conditions were not met, then normal error handling continued. In this manner, BASIC execution was minimally slowed.

The text of the printed article correctly showed the symbol, but because program listings were in a different typeface, Transactor's typesetting equipment substituted "\" in the assembly listing. Or so I was told. I've corrected that in the scans of the Transactor pages.

Except for SmallDOS, this was my only published program that was a modification of someone else's work. I am pleased to see that my port to the Vic-20 has been integrated into WimBasic, an extension for Vic BASIC.

Transactor pages Super Numbers III and John R. Bennett's Original SuperNumbers

The Transactor Online Archive has Volume 1, Issue 1 (April 1978), thru Vol 9, Iss 6 (August 1989). Transactor Disks are also available. Thanks to Craig Bruce for preserving one of the better publications of that era.

Back to Publications or Projects