Classic Computer Magazine Archive CREATIVE COMPUTING VOL. 9, NO. 11 / NOVEMBER 1983 / PAGE 60

Simons' Basic. (evaluation) Tim Onosko.

As personal computers go, the Commodore 64 appears to be a commercial "hit." It is a reasonably powerful machine with plenty of memory and unique graphic and sound features. Its quick acceptance by consumers should not be a surprise, since it is a bargain. (In December, 1982, the 64 sold for $595 and there was almost no discounting of prices. As this is being written, it is generally available for around $225, but by the time you read this, it may be available for even less.)

Shrewd pricing isn't the only trick Commodore has up its sleeve, however. It will soon unveil Simons' Basic, an extension to the resident language of the 64 which will add an unbelievable 114 commands to the machine.

Commodore Basic isn't a bad language. A version of Microsoft Basic, it has very few peculiarities and no major bugs. Its only real problem is that it didn't grow up with the company's computers. While it was serviceable for the original 8K Pet, which had no color, sound, or high-resolution graphics, Commodore Basic just isn't enough for the 64, which has all of those features.

In fact, the complaint about the 64 has often been that its power is difficult to unlock from Basic, and novice users are shut out completely by the complexity of the task. The Apple computers at least have a few screen commands in their Basic, and the Atari computers have even more. Programming even the most rudimentary graphics and sounds on the 64 is an endless job of PEEKing and POKEing.

Simons' Basic offers not only a solution to the problem but almost makes the 64 into an entirely new computer. (Probably the one it should have been in the first place.) The 114 new commands are so comprehensive that they make Simons' Basic more than a good language extension. It may be one of the very best ever designed. I predict that it will cement the popularity of the 64 and become the standard language for programming the machine. Background

The origin of Simons' Basic is interesting in itself. It was created by a British programmer named David Simons, whose parents gave him his first computer just three years ago on his thirteenth birthday. (Commodore's founder and president, Jack Tramiel, should adopt the kid and make him heir to the company fortune, or at least pay him enough to keep him writing for his computers for life.) According to the official company legend, Simons surveyed other Basics and their extensions and picked from among their features. That is probably true. Simons' Basic resembles other recent extended Basics such as BasicA for the IBM PC.

Simons' Basic is packaged as a ROM cartridge, and should be available by the time you read this. At press time, no price was announced by Commodore, as the program had not yet gone on sale either in the United Kingdom or in the U.S. In the U.K., however, a price of 50 pounds sterling--or about $75--has been announced.

Okay, so what's so good about Simons' Basic? That requires more than just a few sentences. The new commands are grouped into several categories: Programming aids ("toolkit" commands and other conveniences); new Basic words for inputting information; arithmetic and math extensions; disk functions; high-resolution graphics; screen manipulation; sprite graphics words; error trapping schemes; music notation; and commands that read controllers (light pens, joysticks, paddles, etc.). Finally, another set of new words is used for structural programming, and can make this Basic very Fortran-like, if you choose to use them. (And I bet you will.)

Obviously, there isn't enough space to describe all 114 commands. (How does all that stuff fit?) Here is a rundown of each category and the highlights of Simons' Basic: Programming Aids

Though the classic "toolkit" functions, like AUTO (for automatic line numbering), RENUMBER (for renumbering lines) and FIND (for searching for commands and strings) are here, some of the most impressive commands are not just debugging aids. PAUSE, for example, pauses a program for a length of time you specify. If you press the RETURN key before the time is up, the program will continue. It is very handy. CGOTO lets you GOTO the number of a line calculated by the computer. KEY assigns commands or other words or keystrokes to the function keys of the 64, and is used for single-key entry. DISAPA and SECURE are used to hide permanently program lines you want to keep from prying eyes. OLD reverses a NEW command.

My only complaint with any of these was RENUMBER, which does not renumber GOTO and GOSUB statements. The book says you won't need them because you will be using "structured" program style (more on this later). I disagree, and found that I immediately wanted to renumber old programs written in original Basic. Input Handling and Text Manipulation

Hardcore programmers will go crazy over new input routines. I admire the work here, but was fairly happy with INPUT and GET and not much bothered by their limitations. Nonetheless, FETCH is a major improvement which sets limits to the length and type of information expected by the program. ONKEY gives new meaning to the function keys and replaces dozens of lines of Basic code. New string handling words include INSERT, INST, PLACE, and DUP, which allow far finer dissection of strings than I have ever seen. Three great screen commands are PRINT AT, which eliminates moving the cursor around with loops or multiple PRINT statements, CENTRE (British, remember?) which prints text centered on a line, and USE, a form of PRINT USING.

The new string commands open many, many possibilities unavailable in Basic, and lend themselves to the kind of natural language processing that Basic programmers have only dreamed of. As for the screen commands, PRINT AT, USE, and CENTRE, these come as a relief to anyone who has ever wasted time trying to simulate them. Numeric Aids

MOD returns the remainder when one whole number is divided by another; DIV returns the whole number (integer) and drops the fractional part. FRAC gives you the fractional part of any number, in decimal form. EXOR performs that logical operation known to mathematicians as an "exclusive or." The commands that most programmers may end up using most are those that do automatic conversion among binary, decimal, and hexadecimal numbers.

If you are involved in understanding the machine on its own level, you know that hexadecimal numbers are vital to programming machine code. Some people pick up on hex and binary numbers quickly and easily. I didn't, so I found these commands a relief. Disk Commands

There are only two of these, DIR, which gives you a disk directory (lots of options here) and DISK, which allows you to perform most other disk operations without the OPEN, PRINT#, and CLOSE statements required by Commodore Basic.

These almost replace the Wedge (DOS Support) program familiar to anyone who has used any of Commodore's disk systems. Almost, that is, except that you can't easily read the disk drive error channel to find the exact nature of a file-handling mistake. Will this cause big problems? I don't think so. It is unfortunate, though, that you can't yet use Commodore's Wedge in conjunction with Simons' Basic. (Wedge will have to be rewritten.) Graphics

Here, as expected, is where Simons' Basic really shines. It gives you instant access to high-resolution (320 by 200 pixels) and multicolor (160 by 200) graphic modes. These let you draw defined shapes--REC, for rectangle, CIRCLE, ARC--with a little bit of thought and almost no effort. PAINT fills the shapes with a color. You can also PLOT dots and DRAW lines, of course, and mix TEXT (another command) of several different sizes with the graphics.

These are the commands that will instantly sell Simons' Basic. One line containing any of the eighteen commands eliminates dozens of lines of Basic. Screen Manipulation

The commands in this category are "extras." None is terribly vital, but each so easy to use that they will be favorites for adding those "bells and whistles" to programs. There are several variations on FLASH, which flashes alternate colors of the screen border, background, and characters. SCRSV lets you save screen text and designs as disk or tape files; scroll commands move areas of the screen in up to four different directions simultaneously. COPY dumps a high-resolution screen to a dot matrix printer. HRDCPY, for hardcopy, does a similar thing for screens of text.

There are some who may argue over the necessity of these commands--there is a total of fifteen--but that's not the point. This is meant to be an enhancement, remember? Sprite and Character Graphics

Sprites are small pictures that the 64 can move around the screen. They are defined as a one-color block of pixels 24 dots wide by 21 dots high. Multicolor versions of sprites are four-colors (including the background color), but half the horizontal resolution. In addition, the 64 lets you use a "soft" character set that can be redefined for foreign language characters, special symbols, graphics, etc. Eight new Basic commands (and variations) let you define and move sprites around the screen and redefine the characters.

This is just one approach to the problem of simplifying these kinds of graphics. I am not so sure that the way it is done in Simons' Basic is the best way, but it is the best I have seen. Music and Sound

Like the sprite commands, new music words offer the best solution yet of how to "talk" to the 64 synthesizer chip, called SID (for Sound Interface Device). VOL sets the overall volume of sound; WAVE assigns each of three voices a waveform, selecting from sawtooth, pulse/square wave, and triangular waveforms, noise and ring modulation. ENVELOPE lets you "shape" the sound. With MUSIC (another command), you can easily enter musical notes and build song tables. PLAY, which actually produces the sound, has two modes. In the first, the program pauses while music or a sound effect is playing. In the second, the sounds play while the program runs.

Frankly, without commands like these, there is no hope for the Basic programmer who wants to create music easily on the 64. These commands will still take work to understand and use properly, but they are quite good. Structured Programming

Here is where the real power of Simons' Basic lies, though I am not sure how many first-time programmers will use these new commands. With PROC, you can define and name a procedure, which is kind of a substitute for the traditional Basic subroutine. The name is used to identify the first line of the procedure, and END PROC is used on the last line. This may sound like a frill, but it isn't. The advantages of using this kind of organization in a program will become apparent to you. For one thing, there are no more GOSUB line numbers to memorize and mess with. One reason RENUMBER doesn't work on GOSUBs and GOTOs is to encourage you to use procedures.

Veteran Basic programmers may take a little while getting accustomed to this, but the effort is worth it. First-time users should learn to program in this style immediately. It actually makes Basic readable and workable. Structured programming commands also enhance loops, with IF . . . THEN . . . ELSE, REPEAT . . . UNTIL, LOOP . . . EXIT, IF . . . END LOOP, and with words that limit the values of variables to specific areas within a program. Lastly, ON ERROR is designed to improve error trapping. It allows a program to continue running, even though one of many different errors might normally occur. The program simply branches to a section where the error can be studied and corrected. Summary

In my opinion, Simons' Basic stands an excellent chance of becoming the standard Basic for Commodore 64 programs. This can be argued. For example, a Basic expansion has been available for the little Vic-20 almost from the start, but it never really caught on. Very few (if any) published programs take advantage of the Super Expander cartridge that includes new color, graphic and sound commands.

Still, BasicA (Advanced Basic) has become the official Basic of the IBM PC, and no user of that machine would be without its excellent capabilities.

A final word about the Simons' Basic package. A note of thanks should be given to Commodore's U.K. division for assembling a very fine manual. It is thorough but concise, and all of the examples I entered from the book actually worked! (If you have ever worked with a Commodore mnual, you know what a joy it is to say this.)

I think many, many people are going to enjoy Simons' Basic, and an equal number are going to flabbergasted by its power. Commodore had better be planning to manufacture lots of copies because they will go fast.

Products: Simons' Basic (computer program language)