Classic Computer Magazine Archive ANTIC VOL. 4, NO. 2 / JUNE 1985

assembly language

TURBO TYPO II

Speedy three-line enhancement

by DAVID McLAUGHLIN

Changing three lines in TYPO II gives assembly language speed to Antic's program typing checker (See Listing Section.) TURBO TYPO II will work on all Atari computers of any memory configuration.

When Andy Barton started working on TYPO II, he wrote it as a machine language vertical blank interrupt routine which fit in Page Six of memory. Following a suggestion from Bill Wilkinson of Optimized Systems Software-who wrote the original TYPO-we decided to switch to an all-BASIC TYPO II. Antic felt that novices, who most needed TYPO II, would have a much easier time if they didn't have to type in a lot of data statements.
   We also wanted a simple program that the widest range of readers could have fun tinkering with. (See the I/O pages in both the April and May issues for some earlier enhancements.) Judging by the many thank-you letters from new Atari users and the large number of improvements that more experienced readers have sent in, Antic certainly succeeded in both goals. -ANTIC ED

TURBO TYPO II
TYPO II is an enormous help, but it does have an annoying drawback- the longer the line, the more time required to check it. My object was to speed up TYPO II while producing the same two-letter code checksums.
   I noticed the slowdown came from line 32150 of the original code. This line was an elegant solution, creating a unique code that also checks for correct letter order (i.e. distinguishes between TO and OT).
   Therefore, the best way to speed up TYPO II was to write the line 32150 procedure in machine language. Thus, I created Listing 3, TYPO II, in ML. But you do NOT need to type this listing to create an enhanced. TYPO II. It is included primarily for your information.

TWO CHOICES
I have provided two ways to create the necessary enhancements. Listing 1 is all you need to add to the current TYPO II. If you are one of those brave souls who doesn't mind typing in a lot of special and inverse characters then simply use your old TYPO II to type in Listing 1. When done, press [BREAK] then SAVE or LIST your enhanced TYPO II to disk or cassette.
If you'd rather not take a chance on typing tricky characters, then use your old TYPO II and follow these instructions in exactly the following order.

1. With TYPO II running, type in lines 32015 to 32025 from Listing 1.
2. Type in Listing 2.
3. After Listing 2 is successfully entered, press [BREAK] to stop TYPO II.
4. Type RUN and line 32026 from Listing 1 will be created for you.
5. When the READY prompt appears type GOTO 32000.
6. Type in line 32150 from Listing 1 and your enhanced TYPO II is complete.
7. Press [BREAK] and save the new TYPO II to disk or tape by typing:

LIST "D:TYPO II",32000,32220 or LIST "C:",32000,32220.

   If you want a SAVEd version then type NEW and then ENTER the new, enhanced TYPO II and then SAVE it to disk or tape.

SOURCE CODE
Listing 3 was created with the Atari Assembler/Editor cartridge. Of greatest interest is the use of three bytes to calculate TYPO II's variable ANS.
   Normally, in this type of application, the programmer returns the value of ANS back to BASIC through memory locations 212 and 213 (hexadecimal $D4 and $D5) as the Atari creators originally planned. However, ANS can only have a maximum value of 65535, the greatest value two bytes can hold.
   The original TYPO II's design allows ANS to become larger than that after the length of LINE$ becomes greater than about 20-30 characters. But the use of three-byte arithmetic is sufficient to hold the highest possible values of ANS.
   A note of caution: TYPO II in ML uses three Page Six memory locations, 1789-1791 (hexadecimal $6FD-$6FF). Any program that accesses these three locations will be in conflict with the enhanced TYPO II. But since they are the last three locations on Page Six, there should be little problem.

Listing 1   TURBO1.LST Download / View

Listing 2   TURBO2.BAS Download

Listing 3   TURBO3.ASM Download / View

TRBOTPO2.LST Download / View