Sinclair BASIC v C64 BASIC   Leave a comment

Commodore 64 BASIC (Commodore BASIC V2) v Sinclair Spectrum BASIC.  While Commodore 64 BASIC had only 71 keywords (commands, functions, and statements), Sinclair Spectrum BASIC had 86 keywords.

List of Sinclair Spectrum BASIC commands

ABS, ACS, AND, ASN, AT, ATN, ATTR, BEEP, BIN, BORDER, BRIGHT, CAT, CHR$, CIRCLE, CLEAR, CLOSE#, CLS, CODE, CONTINUE, COPY, COS, DATA, DEF FN, DIM, DRAW, ERASE, EXP, FLASH, FN, FOR, FORMAT, GO SUB, GO TO, IF, IN, INK, INKEY$, INPUT, INT, INVERSE, LEN, LET, LINE, LIST, LLIST, LN, LOAD, LPRINT, MERGE, MOVE, NEW, NEXT, NOT, OPEN#, OR, OUT, OVER, PAPER, PAUSE, PEEK, PI, PLOT, POINT, POKE, PRINT, RANDOMIZE, READ, REM, RESTORE, RETURN, RND, RUN, SAVE, SCREEN$, SGN, SIN, SQR, STEP, STR$, TAB, TAN, THEN , TO, USR, VAL, VAL$, VERIFY

I don’t understand all these commands, because I’ve never owned a Spectrum, but I can point out the all important ones for colour, graphics, and sound.

BEEP, BORDER, BRIGHT, CIRCLE, DRAW, FLASH, INK, INVERSE, PAPER, PLOT.

Although the early Spectrum models could only produce monophonic beeps of different pitches, compared to more sophisticated notes, or even 3 note polyphonic synthesised music on other computers, at least the Spectrum had a dedicated BEEP command to do that. Of course, the Commodore 64 required various PEEKs and POKEs followed by 5 digit memory locations, followed by a comma, then any number from 0 to 255 to play notes, draw lines, define sprites, read joysticks, etc, etc. It was virtually impossible to play more than one note at a time using Commodore 64 BASIC. Even my attempts to modify a program which included a machine code routine to play 3 note polyphonic classical music failed miserably. That was when I realised I may as well have bought a monophonic Acorn Electron instead. During my 10-11 months in Commodore 64 hell, I saw an ad for an add on chip for the Spectrum, which gave it 3 channel sound similar to various other computers, probably using the General Instruments AY-3-8910 or 8912 chip. The 8912 chip could apply a different sound to each of the 3 channels, while the 8910 chip was limited to each of the 3 channels playing the same sound, although some variation could be generated by adding a “noise” effect to one or more of the channels.

Another amazing feature of Sinclair Spectrum BASIC was the command PRINT AT [y,x] . Strictly speaking, this wasn’t for graphics, but it enabled the user to specify the VERTICAL y as well as the horizontal x coordinates of a character to be printed on the screen. This enabled a custom UDG (user defined graphic) character to be positioned anywhere on the screen quite easily, as well as having its coordinates checked against other characters to help detect collisions in games. The Commodore 64 just had the PRINT TAB x command, which only allowed the x coordinate to be specified. Positioning a character vertically required the user to create a string of cursor up or down control characters, then use the command LEFT$, MID$, or RIGHT$ to extract some of these to position the character vertically! Of course, it seems that ALL non Commodore computers had the command PRINT AT [y,x] , PRINT TAB [x,y], LOCATE [x,y]:PRINT , or its equivalent.

Advertisements

Posted August 8, 2012 by C64hater in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: