Classic Computer Magazine Archive ANTIC VOL. 8, NO. 7 / DECEMBER 1989


PC Print

Clean printouts from your IBM downloads.

By John West

Print downloaded IBM format text files easily -- without the extra spaces and RETURNs found in standard ASCII files. PC Print replaces the most troublesome control characters even as the file prints. This BASIC program works on all 8-bit Atari computers of any memory size, with disk drive and printer.

If you use a modem, as I do, then you've probably had to cope with IBM text files at some point. Even some text files for the 8-bit Atari are converted to this standard ASCII format when posten on telecommunications services such as CompuServe and GEnie.

You can download files from other computers (from non-Atari bulletin boards) and use them. But, most text files you download have been written on IBMs, which use CTRL-M and CTRL-J to do the same thing Atari does with a 155.

I've spent many an hour taking out CTRL-M and CTRL-J characters from IBM text files after loading them into a word processor. It seems that almost none of the Atari word processors allow you to globally replace a [RETURN]. (The First XLEnt Word Processor is one we know of that will replace RETURNs. We always keep a copy handy for just that purpose -- ANTIC ED)

One time I wrote my own program to simultaneously strip out the CTRL-M's and J's, insert a CHR$(155) and save the file. This takes a lot of time and extra disk space, however. Since all I usually want to do is print the file, I finally created PC Print, a program that replaces the troublesome characters while the file is being sent to the printer.


Type in Listing 1, PCPRINT.BAS, check it with TYPO II, and SAVE a copy to disk. When you RUN this BASIC program, it will create a file named PCPRINT.COM and write it to the disk in drive 1.

Rename this file to AUTORUN.SYS, using Atari DOS selection E. Then when you reboot, PC Print will load and run automatically. (You can also use DOS option L to load PCPRINT.COM, without renaming it.)

If you have an Assembler cartridge, such as MAC/65, you may type in the source code shown in Listing 2 and assemble it. Listing 2 is included primarily for MAC/65 programmers. You do not need to type in Listing 2 to use PC Print.

Then, copy any IBM text file to the printer and it will be converted "on the fly." From DOS, use selection C, and when specifying the destination device, use P: to send the file to the printer. For example, type:


Press [RESET] to disable this special handler.


PC Print takes each byte sent to the printer, checks it and transforms any CTRL-M (13) into a 0, which the printer ignores. Any CTRL-J (10) characters are transformed into an Atari carriage return character (155). Now you can simply copy those IBM ASCII files directly to the printer, without all that annoying double spacing caused by the CTRL-M, CTRL-J sequences.

This is done by redirecting the printer handler vector in Atari's low memory to our own routine in Page 6. All characters other than the CTRL-M and CTRL-J sequences are passed on to the operating system, which handles the actual printing.

If you don't have a modem, I suggest you get one. It will open a fascinating new world of computing, affording the opportunity to share information with many other Atari and non-Atari computer users. Many popular bulletin board systems, often run by Atari computer clubs, are found all across the US, running on Atari 8-bit machines.

John West is a Senior at Perquimans County High School, North Carolina. He taught himself BASIC and Assembly, and then learned LOGO, PASCAL, and XLISP by attending summer college programs. This is his first appearance in Antic.

Listing 1: PCPRINT.BAS Download

Listing 2: PCPRINT.M65 Download / View