30.12.2013 Views

May June 1980 - Commodore Computers

May June 1980 - Commodore Computers

May June 1980 - Commodore Computers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MAY/JUNE. I <strong>1980</strong>. ISSUE 4. COMPUTE. 111 Ill<br />

CHEEP PRINT Hard Copy For Soft<br />

CHEEP PRINT SOFTWARE<br />

Cheep Print for PET is written mostly in<br />

BASIC; a little bit of machine code is used to<br />

BASIC; a little bit of machine code is used to<br />

insure accuracy in timing the output signals. I have<br />

chosen to put the machine code in the second cassette<br />

buffer, but the code is completely relocatable and may,<br />

for instance, be placed in high memory if you change<br />

the top-of-memory pointer and command CLR before<br />

trying to run the program (neglecting CLR causes<br />

trying to run the program (neglecting CLR causes<br />

strings to overwrite the machine code; you can guess<br />

how I found thiss out.)<br />

The BASIC part of Cheep Print is designed to<br />

live at the beginning of some other program, which<br />

I[ will refer to as the host program, and serves both<br />

to list the host program while it is under development<br />

and as data output software after the program has been<br />

completed. The host program is assumed to have<br />

line numbers of 100 and up. I have tried to structure<br />

Cheep Print so that it contains subroutines that can be<br />

called by the host program. . If you look over the<br />

listing of Cheep Print, which was produced by Cheep<br />

Print itself-- the comments were added afterwards<br />

for documentation -- you will see that most of the<br />

program is taken up with formatting the output for<br />

the printer, and with the details of listing a program.<br />

To use Cheep Print, start by making a master<br />

copy of the program that contains all the options that<br />

you might ever need; this copy should be saved for<br />

future use. Then make a sub-master that has the<br />

various parameters and options for the printer that<br />

you will be using most. You can simply load the<br />

master and delete those options that aren't needed,<br />

incidentally gaining more space for the host program.<br />

You will probably want to use Cheep Print to list<br />

itself a few times, just to make sure that the formatting<br />

is satisfactory, and to gain familiarity with<br />

the sequence of operations required. When you are<br />

about to start developing a new program, enter the<br />

sub-master copy of Cheep Print and then key in the<br />

host program. As you save your host program,<br />

Cheep Print will come along with it. Line 1 of<br />

Cheep print is a GOTO to the entry point of your<br />

host program, so that a simple RUN command will<br />

execute the host program. If you want a listing of<br />

any part of the program, m , simply command RUN 10;<br />

you will be prompted to check that your cassette<br />

recorder is properly set up -- — cables connected and<br />

running in record mode -- ~ and then you will be<br />

asked which lines you want listed. The options are<br />

the same as for the screen listing on PET: hit<br />

RETURNRN only, and gett everything; enter A-B B (a<br />

hyphen must be used as a separator here) and you get<br />

lines A through B inclusive; A- gives everything from<br />

Cost Cos!<br />

C A McCorlhy<br />

McCarthy<br />

1359 W Idaho Ave<br />

SI St Poul. Paul. MN 55108<br />

A onwards, B- gives everything up through B; and A<br />

alone, with no hyphen, lists the single line A. As the<br />

program listing proceeds, the line that is currently<br />

being processed for the Cheep Print output is listed<br />

at the top of the screen. When the message "BREAK<br />

IN 80" appears, the listing is done and you can turn<br />

off the recorder.<br />

One of the Cheep Print listing options is to put<br />

One of the Cheep Print listing options is to put<br />

each statement on its own private print line, thus<br />

leaving much welcome space for comments. I have<br />

used this style for the listing of Cheep Print; I hope<br />

that the comments on this listing suffice to explain<br />

what is going on, , and how to structure the various<br />

options for your specific needs. There is, however,<br />

one point that must be emphasized. The LIST instruction<br />

of line 2 needs to have precisely five characters as<br />

argument. The first time that you enter Cheep Print<br />

from the keyboard, key in something like 2 LIST­<br />

LIST-<br />

LINES or 2 LIST12345. This is important because<br />

eventually line numbers are going to be POKED here<br />

by the commands of line 19; we need to leave<br />

enough room for the longest possible line numbers of<br />

five digits.<br />

The other principal subroutines of Cheep Print,<br />

which the host program may find useful, are:<br />

which the host program may find useful, are:<br />

3-4 contains identification information such as the<br />

name of the program, date, revision, etc.; I have<br />

found this useful also when SAVEing or VERIFYing<br />

a program with PET's internal cassette recorder. The<br />

command LIST 3 puts this data on the screen, then<br />

I type the word ""SAVE" and two spaces over the line<br />

number and S$-; hit RETURN, and the program gets<br />

saved with a title, without the fuss of entering<br />

the title by hand.<br />

7 outputs the string PS, P$, and 8 outputs the single<br />

character which has ASCII code P.<br />

39 effects a carriage return and linefeed, and<br />

updates the variables PX and PY which give the<br />

current print position at the printer.<br />

40-41 checks whether it's time for the printer to<br />

go to the next page, and if so, it executes 42-44.<br />

42 linefeeds to the end of the current page,<br />

43 is an option, useful for continuous roll paper;<br />

if the initial "RETURN" is deleted, a line of hyphens<br />

if the initial "RETURN" is deleted, a line of hyphens<br />

is printed at regular intervals, so your paper can be<br />

cut neatly into single sheets of uniform size. With<br />

fan-fold paper, line 43 may be ignored.<br />

44 linefeeds to the top margin of where you<br />

want to start printing on the paper.<br />

45-49 format the string S$ for output: space from<br />

the left edge of the paper to the left margin, print SS S$<br />

if it fits on the current line; if it doesn't fit, output as<br />

much as does fit, , aand then repeat the process with<br />

the portion of SS S$ that's left over.<br />

70 is a general purpose start-up routine. It calls<br />

70 is a general purpose start-up routine. It calls

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!