Classic Computer Magazine Archive COMPUTE! ISSUE 36 / MAY 1983 / PAGE 192

Screen Printer For The Atari Wedge

Michael E Hepner

Because of its flexible design, the Atari Wedge (published in the November 1982 issue of COMPUTE!) can be expanded to include countless new commands. In this Wedge update, SPRINT is added which sends an entire screen to the printer.

Every Atari owner with a disk drive knows how long it takes to go to DOS and return. I do not wish to find fault with the design of DOS 2.OS. I have several programs that need every spare byte of RAM. So by having only the minimum essential logic in memory and having the extra options in a separate, nonresident module, there is more RAM free for my own use.

But most of my programs are small, leaving plenty of memory unused. It is annoying to wait for memory to be swapped as you go to DOS when you know that 20K of RAM is sitting idle in your computer. But now, with the Wedge, this is no longer a problem. I can use my large programs as always, but for my short programs, I can have Wedge automatically loaded and use all of the disk commands that I normally use without the time delay.

As much as the disk commands have helped me, the nicest feature of the Wedge is its table-driven design. Any new function can be added by simply adding the command name and the address of its routine to the table of commands. In this article, I will show you how to add a utility to copy a text screen to the printer.


Although I wrote a program that worked, making it easy to use wasn't so easy. The Wedge has taken care of that problem for me. I chose the command name SPRINT because of the similarity to the LPRINT command. Instead of sending a line to the Line PRINTer as LPRINT does, SPRINT sends an entire Screen to the line PRINTer.

The screen printer routine prints everything on the screen, up to (but not including) the line with the SPRINT command. The routine reads the screen by changing the operation mode in the Editor's Input/Output Control Block to the special editor input mode which is mentioned on page 27 of the BASIC Reference Manual. The routine also changes the vector to the Editor Get routine to bypass the Wedge until the print operation is complete, so that nothing on the screen is accidentally interpreted as a Wedge command.

Program 1 is a BASIC loader for the revised Wedge. It is very similar to the loader in the original Wedge except for the DATA statements. I apologize that most of the DATA statements have changed. I had hoped that only a few bytes other than the end of the program would have to be changed.

Program 2 is the assembly language listing of the screen printer routine alone. If you have an Assembler Editor cartridge and wish to add this routine to the original Wedge, you must take the steps listed below to break the Wedge into two parts, renumber the second part, merge the two parts together again, and then type in the new code for the screen printer routine. The comma-M in the last step is required to merge TEMP with the program in memory.

DEL 100, 3140
REN 9000, 10
DEL 3150, 3390


Program 3 is for anyone who is writing programs in machine language and wants to convert them into a BASIC loader program. Along with converting the machine language to BASIC DATA statements, Program 3 also counts the number of bytes in the machine language program, computes the checksum of those bytes, and writes this information to the lowest numbered DATA statement. I used Program 3 to generate the DATA statements in Program 1. To use Program 3, you must first assemble your program and save the machine language output as D:AUTORUN.SYS. Then put in the BASIC cartridge and run Program 3. The DATA statements will be written in LIST format to the file D:DATA. LOAD the main part of your loader program and type ENTER "D:DATA". The DATA statements will be added to your loader program.