Atari BASIC

3 versions exist, “A”, “B”, and “C”. “A” was available for the 400/800 computers, “B” was built in the XLs, and “C” was built in the XEs (carts of B and C were also made).  To determine what version you have enter “PRINT PEEK (43234)”. Rev A returns a value of 162, Rev B is 96, and Rev C is 234.  For a complete run-down of the different versions, and who did them, check out this site.

Rev A was a beta version from Shepardson Microsystems, Inc. (SMI), the company Atari contracted to write Atari BASIC.  Atari had contracted with Microsoft for them to made BASIC for the 400/800, but when it came in at 16K, Atari didn't want to pay for the larger ROM space (either onboard or on carts), so they paid another company (SMI) to make an 8K version.  As a result of trying to fit their program onto an 8K cartridge, as well as working on a tight schedule, Atari BASIC was plagued by 2 problems that caused it to be one of the slowest-performing BASIC languages for any computer – a poor implementation of line number lookups in loops and jumps, and a poor implementation of multiply and divide.  Unfortunately, Atari never attempted to correct the problem in subsequent versions, even though SMI identified and fixed a number of bugs (some serious) that cropped up in the initial release.  BASIC A+ (1981 by OSS) the bug-corrected version of Rev A on disk with most of the problems corrected and added some of the features that were dropped (to fit into the 8K cart).  There were several different versions of this as well, and later evolved into BASIC XL (1983) and BASIC XE (1985).

The original cart releases were labeled “BASIC Computer Program” (picture #1), which was later changed to “BASIC Computing Language” (pictures #2 and #3).  The last releases were labeled “Atari BASIC Computing Language” (pictures #4 and #5).

BUG: Rev A – An input statement with no variable is not flagged as an error when input.

BUG: Rev A – LPRINT loops cannot be stopped by hitting BREAK (this is not actually a bug in BASIC, but a bug in the OS cartridge).

BUG: Rev A – PRINT A = NOT B locks up the keyboard.

BUG: Rev A – DIM L (10) generates DIM L10) as code.  You must not leave a blank between a variable and its dimension or it will be interpreted incorrectly.

BUG: Rev A – The following functions have wrong values:

LOG(0)
CLOG(0)
LOG(1)
CLOG(1)

MOST EXPONENTS (as an example, try to evaluate 23. This problem is inherent in the polynomial expansion algorithm used. It is not likely to cause problems as the errors are very small, but will be noticeable when the expected value is something which is known. This is a simple rounding error, and can be handled by rounding the result when a non-integer result would be bothersome).

BUG: Rev A – Problems with BASIC boundary routine. This manifests itself in two bugs on the machine. Sometimes when doing line editing the machine will lock up. This usually occurs when deleting multiple lines from a program. The other problem is that any string which is an exact multiple of 256 bytes long will end up in the wrong place if moved in memory. This causes some very weird inexplicable errors in programs. It is hard to catch because it occurs when a string is a multiple of 256 bytes long, and only then. Please notice that it does not depend on the dimensioned length of a string, but on its actual length. Therefore, it cannot be avoided by never dimensioning strings to these values. Fortunately it rarely shows up since most strings are shorter than 256 characters.

BUG: Rev A – A printed Control-R or Control-U is treated as a semicolon. I'm glad I finally found out about this as it was the cause of a great deal of trouble in a graphics dump routine I wrote.

BUG: Rev A – You cannot use a function within a USR call line. That is, you cannot use a function to define an address for a user call or any of its parameters. You can do this if you evaluate them in a separate line, however.

BUG: Rev A – You can dimension arrays larger than the available memory size without creating an error. Of course, there will be problems galore and error messages when you try to run the program.

BUG: Rev A – A bug in the code causes the keyboard to lock up, forcing you to turn the system off and back on (RESET doesn’t work).  It was a fairly simple bug in some library code used for moving memory around on the 6502.  Apparently this bug cropped up as a side effect of a mistaken "cut and paste" between two sections of the library - the one that added room for new lines, and the one that compacted memory when removing lines. Under a certain condition the code would skip over 256 bytes during compacting and ruin the program.

BUG: Rev B – Each time you SAVE and LOAD a BASIC program, the file is expanded by 16 bytes.  This is cumulative, so in program Development you may run out of memory sooner than you should, especially if you have only 16K RAM.  Although not a permanent fix, using LIST and ENTER instead of SAVE and CSAVE (or LIST”C” and ENTER”C” instead of CSAVE and CLOAD) may minimize the potential for problems.

BUG: Rev B – Your keyboard may lock up unpredictably while you are programming, or you may get garbage in the list.  These two flaws are due to the same bug, and the occurrence is fatal to that run of the program.  Atari attempted to correct the lock-up bug in Rev A for the 1200XL and removed the problem code.  But then they attempted to fix something that wasn’t “broken” and ended up creating the same problem, and more.

BUG: Rev B – After a long session with a BASIC program, I always LIST it to disk, type NEW, and then ENTER the programs in order to clean up the variable-name table. On several occasions, with the 800XL, I've encountered ERROR 9 (string not dimensioned) when I ran the cleaned-up program. Using the CLR command doesn't help in this case, nor does pressing [SYSTEM RESET]. If I subsequently SAVE and LOAD) the program, it runs fine, but I'm still not able to ENTER and successfully RUN the LISTed version. This seems to occur only with large programs.  Another LIST and ENTER problem occurs only with some files. The ENTERed program refuses to run. If you have wisely SAVEd the file as well, LOAD it and delete one byte from a REM statement or from some other harmless place. Now you should be able to LIST and ENTER it without difficulty.  I've used the Editor of my Assembler Editor cartridge (ASM/ED) to edit LISTed BASIC programs for three years now without incident, because ASM/ED's FIND and REPLACE commands make it easy to clean up a program listing. I've had problems ENTERing a LISTed BASIC file from the 800XL, however, I frequently get ERROR 137 (truncated record). I can't figure this out, since BASIC ENTERs the same file with no problem.  {Matthew Ratcliff}

BUG: Rev C – Differs from Rev B only in two parts: Part 1 is that it removes trash near the end of the cart-ROM, where, apparently, the Atari engineers left some trash from a previous game (?) – “,7inner”.  The other difference is that C fixes the byte-mover of B, which is defective.

BUG: Both Rev B and Rev C have a couple of questionable "improvements" - one of them being the rounding of the exponential.  N^M is computed by the math pack through exp(M * log (N)), but due to the rather poor implementation of log and exp there, the result always comes out too small.  Rev B "fixed" that by always (!) rounding up to the nearest integer if N and M are integers.  Now, with the improved math-pack in Os++, the ROM of the Atari++ emulator, exp and log no longer come up too small, but as precise as possible with BCD arithmetic.  As a result, 4^4 is a tiny fraction larger than 16 (16.000001 or so), and as a result, Rev B and Rev C evaluate it as 17.   Rev A gives the not rounded, but more precise, result.

 

 


Return to main menu