LIST OPTION
by Stephen Bugg
from ZX Computing Oct/Nov.1984

Stephen Bugg's [program] makes the ZX81 LIST like a Spectrum.


[Start of paragraph not printed in magazine. JimG.]

this program which will scroll through the lines of a
program from any starting line you desire to the end or to
any specified line.

As it stands it is not particularly helpful, but all it
needs is renumbering to a suitable high line number (say
9000), and to be loaded into your computer and left there
before each programming session.


Comments

1000-1003  Input bounds of printouts of lines.
1005-1008  Find bounds of memory allocated to program.
1009       If first line is not wanted then goto find first line sub-routine.
1010       Check for end of program.
1020       Read line number (first two bytes of line).
1022       Check if after last desired line number.
1025-1030  Print line number in front of LIST command, bbbXb.
1035       Increment address pointer by 2, number of
           bytes used for the line number.
1040       Reads number of characters in line.
1045       Increment address pointer by 2, number of
           bytes used for line length.
1050-1085  Loop for each item in line except newline at end.
1053       Check if pause is wanted. Pause routine at 1125.
1055       Load A with value of address to which is being
           pointed. X is first text address in line, Z is
           position in line.
1060-1065  Character 126 (NUMBER) follows a number in memory, and this is in
           turn followed by another 4 characters. These 5 characters do not
           want to be printed, and these 2 lines avoid this being done.
1070       Print character held in A.
1080       If Print line is 3 then move to SCROLL routine.
1095       Increment address pointer by length of line.
1010-1100  Loop for each line in program.
1105-1120  SCROLL ROUTINE
1105       Load B with Print column.
1115       Set Print position to correct position, one line above previous
           position. After scroll the next character will be printed immediately
           after previous character.
1125-1130  PAUSE ROUTINE
1125       Return to main routine if pause is to end, if "Q" is pressed.
1140       FIND FIRST DESIRED LINE
1140       Read line number.
1145       If reached starting position then goto main routine.
1165       Read line length.
1160&1170  Increment address pointer by line length.


Variables

A       Value of address at pointer.
B       Print column.
DFILE   End of program address.
ED      Last line desired.
ST      First line desired.
X       Address pointer, starts at 16509, line 1005
        and is incremented as byte is read, Lines
        1035, 1045, 1095, 1160, 1170.
Y       Line number (1020 and 1140) and Line
        length (1040 and 1165).
Y$      String to print out line length.
Z       Counter for line length.


Operating Instructions

RUN 1000 and GOTO 1000 will call the routine.

START LIST asks for the first line that is to be printed.

END LIST asks for the last line that is wished to be
printed.

The program will now list the lines between these two line
numbers inclusive. It will not stop until the end, unless
the Pause Routine is called; this is done by pressing the
'S" key. The Pause is disabled by the pressing of the 'Q"
key. By pressing the break key the user can stop the routine
and the listing will remain on the screen. The line numbers
used can be changed for something that is more acceptable
such as 9800-9999, but the GOTO's will also need to be
altered. Also the variable names may be changed if the same
variable is used by the programs and cannot be changed. If
the variables need to be retained then GOTO 1000 must be
used as RUN 1000 will clear these variables.


--
Another Fine Product transcribed by:
Jim Grimwood (jimg@globalnet.co.uk), Weardale, England
--
