Simons' BASIC
Simons' BASIC is an extension to BASIC 2.0 for the Commodore 64 home computer. Written by British programmer David Simons in 1983, who was 16 years old at the time, it was distributed by Commodore as a cartridge.
It is widely, but incorrectly, called "Simon's BASIC", because of confusion between the first name "Simon" and the surname "Simons".
Features
Simons' BASIC added an array of features to Commodore BASIC 2.0:- 114 additional keywords
- commands to ease the coding of sprites
- commands to ease the coding of high-resolution and multicolor graphics
- commands to ease the coding of sound
- commands to aid in structured programming
- keywords to assist in writing and editing BASIC programs, similar to those in the VIC-20 Programmer's Aid cartridge
Because a portion of the cartridge data is mapped into memory at addresses, which overlaps part of the standard C64 BASIC RAM, the amount of available memory for BASIC programs was less than that of a standard C64 configuration.
An extension was written by Simons and released by Commodore on floppy disk and tape as Simons' Basic Extension. This software is also known as Simons' Basic 2. It could not be released on cartridge because the original Simons' Basic cartridge had to be present in order to use the extension. Simons' Basic Extension adds another 91 commands including the much-coveted command which renumbers the destinations of and statements.
The 114 keywords
Sprite (MOB) handling keywords
MOB SET – enables a sprite and defines its attributesMMOB – positions a sprite on the screenRLOCMOB – causes a sprite to smoothly move from one location to anotherCMOB – sets up the two global colors for multicolor spritesMOB OFF – disables a spriteDETECT – initializes sprite collision detectionCHECK – checks for a sprite collisionHigh resolution graphics handling keywords
HIRES – initializes a high-resolution graphics modeMULTI – initializes a multicolor graphics modeNRM – returns to the text displayLOW COL – changes the plotting colorsHI COL – returns to the original plotting colorsPLOT – draws a pixelLINE – draws a lineCIRCLE – draws a circleARC – draws an arcANGL – draws the radius of a circlePAINT – performs a flood fillREC – draws a hollow rectangleBLOCK – draws a solid rectangleDRAW – draws a user-defined set of linesROT – sets scaling factors for DRAWCHAR – plots a text character on a high-resolution screenTEXT – plots a text string on a high-resolution screenTEST – determines whether a pixel is plotted or emptyOther graphics handling keywords
COLOUR – sets the background and border colors; the British spelling is usedCSET – selects a character setMEM – copies character ROM to RAMBCKGNDS – configures extended background color modeFLASH – sets up a screen color to flashOFF – cancels a previous FLASH directiveBFLASH – causes the screen border to flashFCHR – fills an area of the text screen with a given character codeFCOL – changes character colors for a selected area of the screenFILL – a combination of FCHR and FCOLMOVE – copies a section of the screenINV – displays a screen area in reverseLEFT – scrolls the screen leftRIGHT – scrolls the screen rightUP – scrolls the screen upDOWN – scrolls the screen downGRAPHICS – reserved variable that always equals $D000 SCRSV – saves a text screen to tape or diskSCRLD – loads a text screen from tape or diskSound handling keywords
MUSIC – plays a series of notes based on the contents of a string variablePLAY – determines whether the program continues to run during MUSICVOL – specifies the master sound volumeWAVE – specifies a voice typeENVELOPE – sets ADSR parameters for a SID voiceSOUND – reserved variable that always equals $D400Keyboard input handling keywords
FETCH – takes user input with restrictions defined by the commandINKEY – checks for a function key pressON KEY – checks for a given keypress, then performs a branch if presentDISABLE – disables the previous ON KEY directiveRESUME – reenables the previous ON KEY directiveInput peripheral handling keywords
JOY – reads a joystickPOT – reads a paddlePENX – reads the light pen's horizontal positionPENY – reads the light pen's vertical positionSprite/custom character definition keywords
@ – describes one line in a sprite or custom character graphicDESIGN – uses neighbouring @ lines to define a sprite or custom characterError trapping keywords
ON ERROR – sets up a routine to trap error conditionsOUT – ends an error handling routineNO ERROR – cancels ON ERROR and restores normal BASIC error handlingDisk handling keywords
DIR – displays the disk directory without destroying the BASIC program in memory DISK – sends a string to the disk drive's command channelPrinter handling keywords
HRDCPY – sends the text screen to the printerCOPY – sends the high-resolution screen to the printerString manipulation keywords
INSERT – inserts one string into the middle of another INST – similar to INSERT, but overwrites rather than inserting. PLACE – searches for one string in the middle of anotherDUP – duplicates a character string a given number of times.Text formatting keywords
PRINT AT – prints a string at a given screen locationCENTRE – centers a character string on the screen; the British spelling is usedUSE – formats numeric data in strings based on a template, just like PRINT USING on other advanced versions of BASIC on other computers, e.g. the Commodore 128, for example.LIN – returns the vertical position of the cursorMaths keywords
Note: These operations are restricted to values that fit into a 16-bit unsigned integer, instead of the full floating-point range used by the built-in BASIC arithmetic operations and functions.MOD – performs a division operation and returns the remainderDIV – performs a division operation and returns the integer quotientFRAC – isolates the fractional portion of a numberEXOR – performs an exclusive-OR logical operationProgrammer's aid keywords
AUTO – automatically generates line numbers as a BASIC program is enteredRENUMBER – renumbers a BASIC program OLD – undeletes a program accidentally removed by the NEW commandKEY – assigns a string as a macro to a function keyDISPLAY – displays all function key macrosMERGE – merges a BASIC program from tape or disk into the program currently in memoryPAGE – displays a BASIC program listing in page formatOPTION – highlights Simons' BASIC keywords when using the LIST commandDELAY – varies the rate at which the LIST command scrolls the screenFIND – searches the program for a stringTRACE – displays the line numbers as a program is runningRETRACE – displays results of a traceDUMP – displays all variable values except for arraysCOLD – resets the C64Security-related keywords
DISAPA – marks a BASIC program line for hidingSECURE – hides all lines marked with DISAPA so that they cannot be viewed with LISTStructured programming keywords
ELSE – allows an alternative branch for IF/THEN conditionalsREPEAT – start of a REPEAT/UNTIL loop structureUNTIL – defines the loop condition for a REPEAT/UNTIL loop structure, and marks its endRCOMP – reinstates the most recently used IF/THEN/ELSE conditionalLOOP – defines the start of a loop that will run until an EXIT IF conditional is trueEXIT IF – the conditional is true, so it exits the current LOOP/END LOOP structureEND LOOP – defines the end of a loop that will run until an EXIT IF conditional is truePROC – defines the start of a named subroutineEND PROC – defines the end of a named subroutineCALL – jump to a named subroutine defined with PROC/END PROC, and stay thereEXEC – call a named subroutine defined with PROC/END PROC, then returnLOCAL – redefines variables for use in structuresGLOBAL – reverses the effects of a previous LOCAL commandMiscellaneous keywords
CGOTO – equivalent to GOTO, but accepts calculated expressionsRESET – moves the DATA pointer to a given line numberPAUSE – pauses program execution for a specified number of secondsOther
$ and % are also considered keywords, for a total of 114.Trivia
The band Barcelona titled their 1999 debut album Simon Basic in tribute. The album includes the song "C-64".Reception
Creative Computing stated that Simons' BASIC "almost makes the 64 into a new computer. " It praised the "very fine manual" as a contrast to Commodore's usually poor documentation, and predicted that it would become "the standard language for programming the machine … Commodore had better be planning to manufacture lots of copies because they will go fast". Ahoy! wrote "If you do any programming in BASIC and should happen to see this product on a dealer's shelf, do not ask any questions—do not hesitate—just buy it!" The magazine praised Simons' BASIC's power and "excellent manual", and stated that "its price makes it one of the biggest bargains available for the Commodore 64". RUNs review was less favorable, stating that its "many powerful and useful commands … were, unfortunately, implemented very poorly for a commercial package. There is very little command parameter checking, and many things have been overlooked or ignored."The original SIMONS' BASIC cartridge has no provisions for reading the error channel on the Commodore 1541 and Commodore 1571 disk drives, nor can it perform a DIRectory listing of files or issue a DISK command on any disk drive other than Drive #8 when more than one disk drive is connected to the Commodore 64. And while most "standard" BASIC 2.0 keywords can be abbreviated by typing the first or first and second letters and then holding down the SHIFT key while typing the second letter after that, all SIMONS' BASIC keywords must be completely spelled out in full exactly as shown in the accompanying user's manual. This includes the commands COLOUR, and CENTRE, both of which are spelled as in British English and are incorporated that way into SIMONS' BASIC.