Simons' BASIC
Encyclopedia
Simons' BASIC was an extension
BASIC extension
BASIC toolkits —not to be confused with widget toolkits—were a common type of program for 1980s 8-bit home computers...

 to BASIC 2.0
Commodore BASIC
Commodore BASIC, also known as PET BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET of 1977 to the C128 of 1985...

 for the Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...

 home computer. Written by 16-year-old British
British people
The British are citizens of the United Kingdom, of the Isle of Man, any of the Channel Islands, or of any of the British overseas territories, and their descendants...

 programmer David Simons in 1983, it was distributed by Commodore
Commodore International
Commodore is the commonly used name for Commodore Business Machines , the U.S.-based home computer manufacturer and electronics manufacturer headquartered in West Chester, Pennsylvania, which also housed Commodore's corporate parent company, Commodore International Limited...

 in cartridge format.

Features

Simons' BASIC added 114 additional keywords to BASIC 2.0. These included commands to ease the coding of sprites, high-resolution and multicolour graphics
2D computer graphics
2D computer graphics is the computer-based generation of digital images—mostly from two-dimensional models and by techniques specific to them...

, and sound
Sound chip
A sound chip is an integrated circuit designed to produce sound . It might be doing this through digital, analog or mixed-mode electronics...

. In addition, commands were also implemented to aid in structured programming
Structured programming
Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could...

. Keywords to assist in writing and editing BASIC programs, similar to those in the VIC-20
Commodore VIC-20
The VIC-20 is an 8-bit home computer which was sold by Commodore Business Machines. The VIC-20 was announced in 1980, roughly three years after Commodore's first personal computer, the PET...

 Programmer's Aid cartridge, were also included. Also, programs written in Simons' BASIC could employ hexadecimal
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

 numbers in assignments and calculations by including a $ prefix, or binary
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

 numbers by utilizing a % prefix.

Because a portion of the cartridge data was mapped
Memory mapping
In computing, memory mapping may refer to:* Memory-mapped file, also known as mmap* Memory-mapped I/O, an alternative to port I/O; a communication between CPU and peripheral device using the same instructions, and same bus, as between CPU and memory...

 into memory at addresses $8000–$9FFF, which overlapped part of the standard C64 BASIC RAM, the amount of available memory for BASIC programs was 8 KB
Kilobyte
The kilobyte is a multiple of the unit byte for digital information. Although the prefix kilo- means 1000, the term kilobyte and symbol KB have historically been used to refer to either 1024 bytes or 1000 bytes, dependent upon context, in the fields of computer science and information...

 less than that of a standard C64 configuration.

A further extension to the Commodore V2 Basic was also written by Simons and released by Commodore on floppy disk
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

 as Simons' (sic) 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 2 added 91 extra commands including a much coveted RENUMber command which also took care of the GOTOs and GOSUBs.

The 114 keywords

Sprite (MOB) handling keywords

  • MOB SET - enables a sprite and defines its attributes
  • MMOB - positions a sprite on the screen
  • RLOCMOB - causes a sprite to smoothly move from one location to another
  • CMOB - sets up the two global colours for multicolour sprites
  • MOB OFF - disables a sprite
  • DETECT - initializes sprite collision detection
  • CHECK - checks for a sprite collision

High resolution graphics handling keywords

  • HIRES - initializes a high-resolution graphics mode
  • MULTI - initializes a multicolour graphics mode
  • NRM - returns to the text display
  • LOW COL - changes the plotting colours
  • HI COL - returns to the original plotting colours
  • PLOT - draws a pixel
  • LINE - draws a line
  • CIRCLE - draws a circle
  • ARC - draws an arc
  • ANGL - draws the radius of a circle
  • PAINT - performs a flood fill
  • REC - draws a hollow rectangle
  • BLOCK - draws a solid rectangle
  • DRAW - draws a user-defined set of lines
  • ROT - sets scaling factors for DRAW
  • CHAR - plots a text character on a high-resolution screen
  • TEXT - plots a text string on a high-resolution screen
  • TEST - determines whether a pixel is plotted or empty

Other graphics handling keywords

  • COLOUR - sets the background and border colours
  • CSET - selects a character set
  • MEM - copies character ROM to RAM
  • BCKGNDS - configures extended background colour mode
  • FLASH - sets up a screen colour to flash
  • OFF - cancels a previous FLASH directive
  • BFLASH - causes the screen border to flash
  • FCHR - fills an area of the text screen with a given character code
  • FCOL - changes character colours for a selected area of the screen
  • FILL - a combination of FCHR and FCOL
  • MOVE - copies a section of the screen
  • INV - displays a screen area in reverse
  • LEFT - scrolls the screen left
  • RIGHT - scrolls the screen right
  • UP - scrolls the screen up
  • DOWN - scrolls the screen down
  • GRAPHICS - reserved variable that always equals $D000 (the VIC-II
    MOS Technology VIC-II
    The VIC-II , specifically known as the MOS Technology 6567/8562/8564 , 6569/8565/8566 , is the microchip tasked with generating Y/C/composite video graphics and DRAM refresh signals in the Commodore 64 and C128 home computers.Succeeding MOS's original VIC , the VIC-II was one of the two chips...

     chip's base address)

Sound handling keywords

  • MUSIC - plays a series of notes based on the contents of a string variable
  • PLAY - determines whether the program continues to run during MUSIC
  • VOL - specifies the master sound volume
  • WAVE - specifies a voice type
  • ENVELOPE - sets ADSR parameters for a SID
    MOS Technology SID
    The MOS Technology 6581/8580 SID is the built-in Programmable Sound Generator chip of Commodore's CBM-II, Commodore 64, Commodore 128 and Commodore MAX Machine home computers...

     voice
  • SOUND - reserved variable that always equals $D400 (the SID chip's base address)

Keyboard input handling keywords

  • FETCH - takes user input with restrictions defined by the command
  • INKEY - checks for a function key press
  • ON KEY - checks for a given keypress, then performs a branch if present
  • DISABLE - disables the previous ON KEY directive
  • RESUME - reenables the previous ON KEY directive

Input peripheral handling keywords

  • JOY - reads a joystick
    Joystick
    A joystick is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it is controlling. Joysticks, also known as 'control columns', are the principal control in the cockpit of many civilian and military aircraft, either as a center stick or...

  • POT - reads a paddle
    Paddle (game controller)
    A paddle is a game controller with a round wheel and one or more fire buttons, where the wheel is typically used to control movement of the player object along one axis of the video screen...

  • PENX - reads the light pen
    Light pen
    A light pen is a computer input device in the form of a light-sensitive wand used in conjunction with a computer's CRT TV set or monitor. It allows the user to point to displayed objects, or draw on the screen, in a similar way to a touch screen but with greater positional accuracy...

    's horizontal
    Horizontal plane
    In geometry, physics, astronomy, geography, and related sciences, a plane is said to be horizontal at a given point if it is perpendicular to the gradient of the gravity field at that point— in other words, if apparent gravity makes a plumb bob hang perpendicular to the plane at that point.In...

     position
  • PENY - reads the light pen's vertical position

Sprite/custom character definition keywords

  • @ - describes one line in a sprite or custom character graphic
  • DESIGN - uses neighbouring @ lines to define a sprite or custom character

Error trapping keywords

  • ON ERROR - sets up a routine to trap error conditions
  • OUT - ends an error handling routine
  • NO ERROR - cancels ON ERROR and restores normal BASIC error handling

Disk handling keywords

  • DIR - displays the disk directory without destroying the BASIC program in memory
  • DISK - sends a string to the disk drive's command channel
  • SCRSV - saves a text screen to disk
  • SCRLD - loads a text screen from disk

Printer handling keywords

  • HRDCPY - sends the text screen to the printer
  • COPY - sends the high-resolution screen to the printer

String 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 another
  • DUP - duplicates a character string a given number of times

Text formatting keywords

  • AT - prints a string at a given screen location
  • CENTRE - centres a character string on the screen
  • USE - formats numeric data in strings based on a template
  • LIN - returns the vertical position of the cursor

Maths keywords

  • MOD - performs a division operation and returns the remainder
  • DIV - performs a division operation and returns the integer quotient
  • FRAC - isolates the fractional portion of a number
  • EXOR - performs an exclusive-OR logical operation

Programmer's aid keywords

  • AUTO - automatically generates line numbers as a BASIC program is entered
  • RENUMBER - renumbers a BASIC program (but does not fix GOTO
    Goto
    goto is a statement found in many computer programming languages. It is a combination of the English words go and to. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control...

    /GOSUB
    GOSUB
    GOSUB is a command in many versions of the BASIC computer programming language. A GOSUB statement jumps to a line elsewhere in the program. That line and the following lines up to a RETURN are used as a simple kind of a subroutine without parameters or local variables.The GOSUB command may be used...

    statements)
  • OLD - undeletes a program accidentally removed by the NEW command
  • KEY - assigns a string as a macro to a function key
    Function key
    A function key is a key on a computer or terminal keyboard which can be programmed so as to cause an operating system command interpreter or application program to perform certain actions...

  • DISPLAY - displays all function key macros
  • MERGE - merges a BASIC program from disk into the program currently in memory
  • PAGE - displays a BASIC program listing in page format
  • OPTION - highlights Simons' BASIC keywords when using the LIST command
  • DELAY - varies the rate at which the LIST command scrolls the screen
  • FIND - searches the program for a string
  • TRACE - displays the line numbers as a program is running
  • RETRACE - displays results of a trace
  • DUMP - displays all variable values except for arrays
  • COLD - resets the C64

Security-related keywords

  • DISAPA - marks a BASIC program line for hiding
  • SECURE - hides all lines marked with DISAPA so that they cannot be viewed with LIST

Structured programming keywords

  • ELSE - allows an alternative branch for IF/THEN conditionals
  • REPEAT - start of a REPEAT/UNTIL loop structure
  • UNTIL - defines the loop condition for a REPEAT/UNTIL loop structure, and marks its end
  • RCOMP - recapitulates the last IF/THEN conditional
  • LOOP - defines the start of a loop that will run until an EXIT IF conditional is true
  • EXIT IF - the conditional is true, so it exits the current LOOP/END LOOP structure
  • END LOOP - defines the end of a loop that will run until an EXIT IF conditional is true
  • PROC - defines the start of a named subroutine
  • END PROC - defines the end of a named subroutine
  • CALL - jump to a named subroutine defined with PROC/END PROC, and stay there
  • EXEC - call a named subroutine defined with PROC/END PROC, then return
  • LOCAL - redefines variables for use in structures
  • GLOBAL - reverses the effects of a previous LOCAL command

Miscellaneous keywords

  • CGOTO - equivalent to GOTO, but accepts calculated expressions
  • RESET - moves the DATA pointer to a given line number
  • PAUSE - pauses program execution for a specified number of seconds

Trivia

The band Barcelona
Barcelona (band)
Barcelona was an indie/new wave/pop band from Arlington, Virginia consisting of Jason Korzen, Jennifer Carr, Ivan Ramiscal, and Christian Scanniello...

 titled their 1999 debut album Simon Basic in tribute. The album includes the song "C-64".

External links

  • Simons' Basic (evaluation) – By Tim Onosko, Creative Computing
    Creative Computing
    Creative Computing was one of the earliest magazines covering the microcomputer revolution. Published from 1974 until December 1985, Creative Computing covered the whole spectrum of hobbyist/home/personal computing in a more accessible format than the rather technically-oriented BYTE. The magazine...

    Vol.9 No.11, Nov 1983, p.60
  • Simons' Basic Italian Reference Guide by David Simons, Commodore Editor, 1983.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK