Classic Computer Magazine Archive ANTIC VOL. 4, NO. 12 / APRIL 1986

FEATURE REVIEW

ADVAN COMPILER BASIC

POWERFUL NEW ATARI LANGUAGE


BY CHARLES CHERRY

This is important. Advan Compiler BASIC is a spectacular new language for 8-bit Atari computers. Yes, another BASIC-but never has a language given the programmer such an effortless command of the special sound and graphics capabilities of the Atari.
   Advan Language Designs' BASIC is not a compiler for Atari BASIC, like the MMG Compiler. It is an expanded BASIC with powerful new commands. I suspect that Advan BASIC will revolutionize public domain programming. It is even suitable for certain kinds of commercial software development. But most of all, Advan is the ideal language for hackers who program for the pure joy of it.

COMPILED BASIC
A compiler "translates" BASIC into machine language after you write the program, instead of "interpreting" it every time the program is run. That's what makes Advan so much faster than an ordinary interpreted BASIC. This translating (called compiling) usually involves an extra step that can often be complicated and inconvenient. But Advan BASIC has followed the lead of the ACTION! language, with a compiling step that is effortless.
   Programming Advan BASIC feels just like Atari BASIC. The commands and the screen editor work pretty much the same way and it is all very familiar. However, you get syntax checking with English error messages when you type in a line. When you finish the program, you type RUN. The screen goes blank while the program compiles, and then the program RUNs. If there is a runtime error you are dumped back into BASIC and the offending lines are LISTed with English error messages. Very convenient, very neat, very fast.

BUILT-IN P/M
Graphics are one of the Atari's strengths and Advan BASIC puts that power at your fingertips. For example the GRAPHICS command, in addition to its normal uses, can enable Player/Missiles and declare a custom character set. The SETCOLOR command has separate parameters for hue and luminance. No more reaching for the calculator to figure your color code.
   Player/Missile graphics are supported with a command that moves your player for you (just specify the direction and speed), automatically changes your player to create animation (just tell it how fast to change) and can either move your players independently or synchronize them. Other commands detect collisions, create and locate your players. The PDISPLAY command lets you design your players with binary digits. For example the following fragnent creates player #2 starting on 105th line of your screen.
   10 PDISPLAY 2%,ADR(30),105%
   20 GOTO 40
   30 CODE"4,&10000001,
   &0l000010,&00100100,
   &00011000"
   40 REM the rest of the program
   If you are familiar with players, you will recognize the bit map for a player that's four lines high in the shape of a V. This kind of code will be a breeze to debug.
   The percent signs [%] after some of the numbers indicate that these are integers. By specifying which numbers are integers and which are real (floating point), you can make your program much smaller and faster.
   More graphics power: Advan BASIC will do Display List Interrupts for you! This means you can display dozens of colors or players or character sets or almost anything else on a single screen. And nothing could be easier. Use the SETINT@ command, tell it what register, what value to put in it and when to do it. You are allowed eight interrupts, but each of them can be changed as often as you wish. This is a truly wonderful feature. Creating Display List Interrupts and changing them are things which many assembly language programmers find difficult. Promised future enhancements will do custom Display Lists and smooth scrolling. Creating these effects in BASIC will make the owners of other computers curl up and die.
   Sound only gets three commands, but they allow you to play entire songs. Also, the songs play in the background during the Vertical Blank Interrupt and do not affect the rest of your program. The ASOUND command assigns the voice and a line number where the program can find coding for the music (not unlike the PDISPLAY command above). SCONTROL starts and stops the voices independently or together. The SOUND command is the same as in Atari BASIC.

FAST AND EASY
Everyone says benchmarks are meaningless. But this time they are instructive because of the way the code is written. The benchmarks time themselves. Here are the lines of code that do it:

Every other Atari BASIC-
   10 POKE 18,0:POKE 19,0:
   POKE 20,0
   20 REM the benchmark goes here
   30 SECONDS = (PEEK(20) + 256 *
   (PEEK(19) + 256 * PEEK(18)))/60

Advan BASIC-
   10 RTIME
   20 REM the benchmark goes here
   30 SECONDS =TIME/60

   Advan BASIC is filled with shortcuts like this. By the way, it ran my version of the Sieve of Eratosthenes in 13.8 seconds. The MMG compiler took 9 seconds, BASIC XL took 67 seconds and Atari BASIC hasn't finished yet. If that isn't fast enough, you can rewrite key routines in assembly language from within BASIC. Advan BASIC recognizes assembler mnemonics almost as if they were BASIC keywords. Not only is this great for people who know assembly language, but it can be a teriffic learning environment too.
   Of course people use their Ataris for things besides games and graphic demos. Is Advan BASIC up to "serious" programming? It has all the commands of Atari Basic. It also has string arrays. Although strings are limited to 255 characters, string and numeric arrays can go to 64 dimensions! It supports lots of Microsoft-style string functions-including LEFT, RIGHT, MID-and search functions that find bytes and sub-strings within strings. It also has commands to insert bytes and words into strings.

COMMAND COMPLEMENT
Program control is very comprehensive. Commands include IF-THEN-ELSE, a multi-line variation IF-DOELSE-ENDIF, the very powerful CASE, WHILE-WEND, REPEAT-UNTIL and WAIT. If you have only used Atari BASIC, you won't recognize some of these, but once you have used them, you will wonder how you got along without them.
   A complete complement of algebraic functions are included. So are I/O commands. Binary loads and saves are done by a special usage of the GET and PUT commands. The INPUT command can print a prompting message, and there's a variation that accepts strings containing commas. The LOAD and SAVE commands assume a disk drive, so all you have to type is LOAD Myfile. No "D:-what a relief. DOS commands which can be called directly from BASIC are DIRectory, KILL (delete), RENAME, LOCK, and UNLOCK.
   If all this is not complete enough for you, Advan BASIC supports user-defined functions and named subroutines (procedures). These can pass as many as four parameters. You can build a library of your own commands, just as you would with PASCAL, ACTION!, or C. Advan promises that programmer's utility disks are coming soon.
   The price of Advan's power is paid in memory space and Atari BASIC incompatibility. Advan has been very clever in optimizing memory usage. But the BASIC appears to take up about 17K. On the XL and XE models, 14K of this will flip up under the operating system to give you more runtime room. On the 800 this 14K is erased. Advan is not yet recommending the language for the 800, because you have to reload BASIC after each run. I found this only a minor nuisance and recommend it heartily. Advan's built-in DOS is Atari 2.5 compatible and supports the 130XE RAMdisk. But you will not be able to use any other DOS, a disappointment to owners of double-density and high-speed disk drives.
   Advan BASIC is not compatible with Atari BASIC and that is a real shame. So many good programs are waiting to be transformed by the Advan magic. Even when saved in an untokenized form, Advan programs are not the same as Atari BASIC programs. I just hope Advan produces a conversion utility without delay. Also, Advan BASIC compiles to a pseudo-code that requires a 3K runtime package. The copy protection prevents you from duplicating this package. While I sympathize with the author's desire to protect his brilliant work, I do feel that Advan BASIC must produce stand-alone programs. Advan promises an extra-cost runtime package. I hope they will reconsider and include it on the original disks.
   I do not have space to detail all of the other treasures to be found in this wonderful and unique language. The Atari community owes author William Graziano a large measure of gratitude for this super creation. In today's market, it will be very hard to succeed in establishing a new 8-bit BASIC language. I wish Advan the very best. In the meantime, send away for your copy today. You will not regret it.

ADVAN BASIC
Advan Language Designs
P.O. Box 159
Baldwin, KA 66006
(913) 594-3420
$49.95, 48K disk