Exploring the XL
One programmer's perspective
By Matthew RatcliffThis article looks at a number of interesting aspects of Atari's new line of XL computers. If you have an XL machine and Synasembler, the accompanying program listing will convert Synassembler so that it can run on your XL machine without the Translator program.
As an avid user of Atari computers who has been programming on an Atari 400 for over three years, I've been interested in the new XL line for a long time. So, two weeks ago, I bought an Atari 800XL. This article combines information I've gained from my own experiences with the machine and information I've culled from various Atari sources in recent weeks. The opinions expressed here are my own.
Many people, noting that the 800XL is advertised as a 64K machine, assume that it gives you 16K more RAM (random-access memory) for programming than the 48K Atari 800. However, the 800XL actually has about 20 fewer bytes of free RAM in BASIC than the 800 does. Apparently, Atari intended to "bank select" (swap ROM for RAM) the extra RAM in certain programming environments. As a result, they added some "pointers" in lower RAM to help the Operating System (OS) keep track of which RAM/ROM configuration was in effect. These pointers are largely responsible for using up the extra bytes of RAM noted above.
The 600XL and 800XL also come with "built-in BASIC" This is a revision (Rev. B) of the earlier, cartridge-based Atari BASIC (Rev. A). Built-in BASIC corrects certain bugs in Rev.A, but unfortunately, it introduces two new ones. A Rev. C BASIC has been prepared to correct these bugs, and it is now available (see below). Meanwhile, the bugs in Rev. B are as follows:
- 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.
- 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.
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 RESIET]. 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.
New and Improved Operating System?The 600XL and 800XL Operating System (OS) is Very similar to that of the 12OOXL. As a result, it suffers from a similar lack of compatibility with much third party software. Fortunately, Atari has made the translator program available on disk for the XL line. If you load the Translator, you can load and run any third-party software. However, if you press [SYSYTEM RESET] with Translator in memory, this will probably cause your system to crash, forcing you to reload (unless you use the accompanying program as explained below).
Although it's no longer commercially available, my assembler of choice is Synapse Software's Synassembler. Unfortunately, when I first tried it with the XL OS, it didn't work properly. After a long session of disassembly and comparison of the old and new Operating Systems, I found out why. Several commonly-used nonstandard routines have new locations in 800XL OS. Among these are the only two illegal entry points used by Synassembler: the "put character" routine (EOUTCH), and the "get character" routine (EGETCH). The EOUTCH routine has been moved from $F6A4 to $F2B0 in the 800XL, the EGETCH routine has been moved from $F63E to $F24A.
The BASIC program listing at the end of this article reads any unprotected machine-language file from disk and replaces all JSR instructions to the old OS EOUTCH EGETCH routines with the new XL entry points. When I used this program on Synassembler, it ran perfectly on the 800XL without the Translator program, and recovered properly from a press of [SYSTEM RESET]. If your program uses only the two invalid calls noted above, this BASIC program should do the trick for you. Note that it also converts data within the program that happens to look like the invalid JSR's. Any program that this routine successfully converts should no longer require the annoying "double boot" procedure (with Translator) noted previously, and should operate correctly, even if [SYSTEM RESET] has been pressed. But before altering your program, make sure that you've made a backup copy, in case the conversion is unsuccessful.
DOS 3Most of the Atari 1050 disk drives sold so far include DOS 2.0S, but Atari will send a copy of DOS 3 free of charge to owners who write or call Atari for it. Be sure to give them the serial number Of your 1050 drive. DOS 3 increases the capacity of a disk from 88 Kbytes to 127 Kbytes. (With true double-density storage, a disk can hold approximately 180 Kbytes.) The "sectors" of DOS 2.0S have been supplanted by "blocks" in DOS 3. Sectors hold 128 bytes each; blocks store 1000 bytes. DOS 2.0S gives you 707 sectors per disk, while DOS 3 gives you 128 blocks.
This can be a problem if you use small files. DOS 3's basic unit of storage, the block, takes up 1000 bytes. If your file occupies 1001 bytes, it will require two blocks of disk space, thus wasting 999 bytes!
In a similar situation with DOS 2.0S, only 127 bytes are wasted. As a result, the potential additional storage space that DOS 3 offers can easily be lost if you tend to use a lot of short files.
I can only speculate that this system may have been set up in anticipation of the double-sided disk drive originally promised for the 1450XLD. If Atari's programmers allowed for a one-byte (0-255) pointer to any block on the disk, then any block reference greater than 127 refers to side two of the disk.
Better Things To ComeDespite the minor problems and restrictions I've noted here, the new XL machines possess considerably more potential than did the 400/800 line. The built-in expansion port on the XLs makes possible a host of add-ons that are similar to those currently available for the Apple. You also can expect to see inexpensive 80-column boards, additional bank-select RAM cards, and possible DMA (direct-memory-access, or high-speed) hard disk drives. Such features can turn your XL into a very serious computing machine.
It seems that the hardware is always out the door before the documentation is complete. There is no mention in the manuals accompanying the XL machines of how to make use of the extra RAM these machines offer. However, with Translator installed, you can make use of the 4-Kbyte block of RAM from $C000 to $CFFF (49152-53247) from either BASIC or ASM/ED. Your favorite machine-language utility routines can be safely stored here (but you should first either make sure that they're relocatable, or reassemble them at the new address). You can also use this space to store character sets and Player/Missile data. And, by using certain programming tricks, you also can store strings (and possibly variables) here, thus giving yourself - in effect - four additional Kbytes of programming space.
You can order the Translator disk directly from Atari, if there isn't an Atari dealer near you. Simply send your name, address, the serial number of your XL computer, and a check for $9.95 to: Atari Customer Relations, 1312 Crossman Ave., P.O. Box 61657, Sunnyvale, CA 94088.
Those of you who are more technically oriented should order an XL addendum to the Atari Technical Notes (for $4.95) from the same address.
If you want the Technical Notes as well, add $29.95. California residents should add 6 percent state sales tax.
Random ThoughtsThe power supply of the XL machines is completely external to the system. As a result, the XLs are smaller than the 400/ 800 computers. However, the new power supply is about twice as large as the old one, and can get quite warm to the touch. Keep it in a place where air can circulate around it freely, and the supply will run cooler and last longer.
The XL keyboard has a rather "sticky" feel, and the keys "rock" on their supports and give somewhat less than desirable feedback to the typist. I find that the 800XL keyboard lacks the "springy" touch that is characteristic of the 800 keyboard.
Atari Basic's Revision CBy the time you read this, a new, fully debugged version of Atari BASIC will be available. Called "Revision C," the cartridge will be sold for $15 on a first-come, first-served basis by Atari Customer Relations at the above address.
You can tell which revision of BASIC you have by PEEKing location 43234. The byte at this location in Revision A (the version included in all cartridges to date) is 162; in Revision B (the version built into all 600XL and 800XL computers to date), it's 96. If you PEEK this location in Revision C, you'll get the value 234.
Matthew Ratcliff is an electrical engineer and a microcomputer enthusiast. He owns a customized Atari 400 with 48K, and has been programming in BASIC for six years.
Listing: DEREXL.BAS Download
: Convert Synassembler to run on XL OS without Translater