Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape03a_acorn_eu_1989_september.wav » BSRC

BSRC

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape03a_acorn_eu_1989_september.wav
Filename: BSRC
Read OK:
File size: 1653 bytes
Load address: 2000
Exec address: 1900
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM Backwards and forwards lister
   20REM By John Geraghty
   30:
   40:
   50ON ERROR PROCerror
   60MODE6
   70PROCassemble
   80PRINT'"Saving..."
   90OSCLI"SAVE BLIST"+CHR$32+"B00"+CHR$32+STR$~P%
  100CALL intercept
  110PRINT''"Press Return, then use"'"CTRL and SHIFT to scroll listing..."
  120*FX15
  130REPEAT UNTIL GET=13
  140?&1F=1:REM LISTO1
  150LINE 560
  160END
  170:
  180DEF PROCassemble
  190IF ?&20F<&C0 CALL &B19
  200temp=&70
  210scr_flag=&72
  220count_flag=&74
  230oldaddr=&75
  240count=&77
  250rows=&78
  260previous_line=&7A
  270width=&7C
  280:
  290ptra_index=&0A
  300lineaddr=&0B:REM=ptra
  310top=&12
  320page=&18
  330listo=&1F
  340inta=&2A
  350brkv=&202
  360wrchv=&20E
  370pos=&318
  380vpos=&319
  390wind_rt=&30A
  400wind_lft=&308
  410wind_bot=&309
  420wind_top=&30B
  430:
  440osnewl=&FFE7
  450oswrch=&FFEE
  460osrdch=&FFE0
  470osbyte=&FFF4
  480:
  490basic=&8AF3
  500no_spaces=&8A97
  510decode=&97DF
  520print_num5=&9923
  530print_num0=&991F
  540linesrch=&9970
  550print_tkn=&B50E
  560:
  570FOR pass=0 TO 2 STEP2
  580P%=&B00
  590[OPT pass
  600.intercept
  610LDA #count_char DIV&100
  620PHA
  630LDY #count_char MOD&100
  640LDX #scroll_chk MOD&100
  650STA count_flag
  660:
  670.vectors
  680SEI
  690STA wrchv+1
  700PLA
  710STA brkv+1
  720STY wrchv
  730STX brkv
  740CLI
  750RTS
  760:
  770.off
  780LDA #&B4
  790PHA
  800LDA #&DE
  810LDY #&2D
  820LDX #&02
  830BNE vectors
  840:
  850\intercept oswrch to get number of screen rows a detokenised line will occupy
  860.count_char
  870PHA
  880LDA count_flag
  890BNE no_count
  900PLA
  910LDA count
  920CMP width
  930BNE inc_ok
  940LDA #0
  950STA count
  960INC rows
  970.inc_ok
  980INC count
  990.no_print
 1000RTS
 1010.no_count
 1020PLA
 1030JMP !wrchv
 1040:
 1050.scroll_chk
 1060PHA
 1070TYA
 1080PHA
 1090\remove leading spaces
 1100JSR no_spaces
 1110\LINE token?
 1120CMP #&86
 1130BEQ line_tkn
 1140\OFF token?
 1150CMP #&87
 1160BNE exit
 1170JSR off
 1180BRK
 1190EQUB 99
 1200EQUS "Disabled"
 1210BRK
 1220:
 1230.line_tkn
 1240JSR no_spaces
 1250\CR or number token?
 1260CMP #&0D
 1270BEQ first_line
 1280CMP #&8D
 1290BEQ get_line
 1300:
 1310.exit
 1320PLA
 1330TAY
 1340PLA
 1350JMP !brkv
 1360:
 1370.first_line
 1380JSR page_line
 1390BPL set_screen \always
 1400:
 1410.get_line
 1420DEC ptra_index
 1430JSR decode
 1440JSR get_addr
 1450JSR top_test
 1460:
 1470.set_screen
 1480\preserve initial line addr
 1490LDA lineaddr
 1500STA oldaddr
 1510LDA lineaddr+1
 1520STA oldaddr+1
 1530\set non_paged mode
 1540LDA #&0F
 1550JSR oswrch
 1560\screen flag used when listing first screenful
 1570LDX #0
 1580STX scr_flag
 1590\get window width
 1600LDA wind_rt
 1610SEC
 1620SBC wind_lft
 1630STA width
 1640INC width
 1650\CLS
 1660LDA #&0C
 1670JSR oswrch
 1680\PRINTTAB halfway down screen
 1690LDA #&1F
 1700JSR oswrch
 1710LDA #0
 1720JSR oswrch
 1730LDA wind_bot
 1740SEC
 1750SBC wind_top
 1760LSR A
 1770JSR oswrch
 1780JMP into_forwards
 1790:
 1800.forwards
 1810\cursor beside line num; must be underneath for next line
 1820LDA #&0A
 1830JSR curs2
 1840JSR inc_lineaddr
 1850.into_forwards
 1860\get number of rows line will occupy on screen
 1870JSR get_rows
 1880BNE to_screen \always
 1890.backwards
 1900JSR dec_line_addr
 1910JSR get_rows
 1920JSR curs1
 1930.to_screen
 1940JSR list
 1950\preserve vpos
 1960LDX vpos
 1970\cursor up beside line number
 1980JSR curs1
 1990:
 2000\list screenful
 2010LDA scr_flag
 2020BMI up_again
 2030BNE down
 2040LDA vpos
 2050CMP wind_top
 2060BNE backwards
 2070INC scr_flag
 2080.down
 2090CPX wind_bot
 2100BNE forwards
 2110DEC scr_flag
 2120DEC scr_flag
 2130.up_again
 2140CMP #&FE
 2150BEQ main_loop
 2160LDA oldaddr
 2170CMP lineaddr
 2180BNE backwards
 2190LDA oldaddr+1
 2200CMP lineaddr+1
 2210BNE backwards
 2220DEC scr_flag
 2230:
 2240\in main loop, scroll up or down
 2250.main_loop
 2260LDX &FF
 2270BMI escape
 2280\CTRL?
 2290LDX #&FE
 2300JSR inkeys
 2310BCS backwards
 2320\SHIFT?
 2330LDX #&FF
 2340JSR inkeys
 2350BCS forwards
 2360BCC main_loop
 2370:
 2380.inc_lineaddr
 2390LDY #3
 2400LDA (lineaddr),Y
 2410CLC
 2420ADC lineaddr
 2430STA lineaddr
 2440BCC top_test
 2450INC lineaddr+1
 2460.top_test
 2470LDY #1
 2480LDA (lineaddr),Y
 2490BPL not_top
 2500.page_line
 2510LDY #0
 2520STY lineaddr
 2530LDA page
 2540STA lineaddr+1
 2550INY
 2560LDA (lineaddr),Y
 2570BPL not_top
 2580\if no prog in mem
 2590.escape
 2600\cursor to bot of screen
 2610LDA #&1F
 2620JSR oswrch
 2630LDA #0
 2640JSR oswrch
 2650LDA wind_bot
 2660JSR oswrch
 2670BRK
 2680BRK
 2690EQUS "Escape"
 2700BRK
 2710:
 2720.get_rows
 2730LDY #&FF
 2740STY count
 2750INY
 2760STY count_flag
 2770STY rows
 2780JSR list
 2790INC count_flag
 2800.not_top
 2810RTS
 2820:
 2830.get_addr
 2840JSR linesrch
 2850\if line found, (&3D;&3E) points to CR+3; else points to CR at start of next line...
 2860LDX &3D
 2870LDY &3E
 2880BCS not_found
 2890DEX
 2900DEX
 2910DEX
 2920CPX #&FD
 2930BCC not_found
 2940DEY
 2950.not_found
 2960STX lineaddr
 2970STY lineaddr+1
 2980RTS
 2990:
 3000.back_to_top
 3010\carry set always
 3020LDA top
 3030SBC #2
 3040STA lineaddr
 3050LDA top+1
 3060SBC #0
 3070STA lineaddr+1
 3080.dec_line_addr
 3090LDY #0
 3100STY temp
 3110LDA page
 3120STA temp+1
 3130.decla1
 3140LDA temp+1
 3150CMP lineaddr+1
 3160BEQ decla3
 3170.decla2
 3180LDA temp
 3190STA previous_line
 3200LDY #3
 3210ADC (temp),Y
 3220STA temp
 3230LDA temp+1
 3240STA previous_line+1
 3250BCC decla1
 3260INC temp+1
 3270BCS decla1
 3280.decla3
 3290LDA temp
 3300CMP lineaddr
 3310BNE decla2
 3320TYA
 3330BEQ back_to_top
 3340LDA previous_line
 3350STA lineaddr
 3360LDA previous_line+1
 3370STA lineaddr+1
 3380RTS
 3390:
 3400.list
 3410LDY #1
 3420LDA (lineaddr),Y
 3430STA inta+1
 3440INY
 3450LDA (lineaddr),Y
 3460STA inta
 3470JSR print_num5
 3480LDY #3
 3490LDA listo
 3500BEQ list_loop
 3510LDA #&20
 3520JSR oswrch
 3530.list_loop
 3540INY
 3550.list_loop2
 3560LDA (lineaddr),Y
 3570CMP #&8D
 3580BEQ linetkn
 3590CMP #&0D
 3600BEQ endlist
 3610JSR print_tkn
 3620JMP list_loop
 3630.endlist
 3640JMP osnewl
 3650.linetkn
 3660STY ptra_index
 3670JSR decode
 3680TYA
 3690PHA
 3700JSR print_num0
 3710PLA
 3720TAY
 3730JMP list_loop2
 3740:
 3750.inkeys
 3760LDY #&FF
 3770LDA #&81
 3780JMP osbyte
 3790:
 3800.curs1
 3810LDA #&0B
 3820.curs2
 3830LDY rows
 3840INY
 3850.curs_loop
 3860JSR oswrch
 3870DEY
 3880BNE curs_loop
 3890RTS
 3900]:NEXT:ENDPROC
 3910:
 3920DEF PROCerror
 3930REPORT
 3940IF ERR=17 PRINT" at line ";ERL:END
 3950PRINT":"':$&700="LIST"+STR$ERL:$&710=$&8AF6:!&718=&8B0B4C:CALL &710

#� Backwards and forwards lister
� By John Geraghty
:
(:
2� � �error
<�6
F
�assemble
P�'"Saving..."
Z$�"SAVE BLIST"+�32+"B00"+�32+�~P%
d� intercept
nE�''"Press Return, then use"'"CTRL and SHIFT to scroll listing..."
x	*FX15
�� � �=13
�?&1F=1:� LISTO1
�
� �TpB
��
�:
�� �assemble
�� ?&20F<&C0 � &B19
�temp=&70
�scr_flag=&72
�count_flag=&74
�oldaddr=&75
�
count=&77
�rows=&78
previous_line=&7A

width=&7C
:
"ptra_index=&0A
,lineaddr=&0B:�=ptra
6top=&12
@page=&18
J
listo=&1F
Tinta=&2A
^
brkv=&202
hwrchv=&20E
rpos=&318
|
vpos=&319
�wind_rt=&30A
�wind_lft=&308
�wind_bot=&309
�wind_top=&30B
�:
�osnewl=&FFE7
�oswrch=&FFEE
�osrdch=&FFE0
�osbyte=&FFF4
�:
�basic=&8AF3
�no_spaces=&8A97
�decode=&97DF
print_num5=&9923
print_num0=&991F
linesrch=&9970
&print_tkn=&B50E
0:
:� pass=0 � 2 �2
DP%=&B00
N
[OPT pass
X.intercept
bLDA #count_char �&100
lPHA
vLDY #count_char �&100
�LDX #scroll_chk �&100
�STA count_flag
�:
�.vectors
�SEI
�STA wrchv+1
�PLA
�STA brkv+1
�
STY wrchv
�STX brkv
�CLI
�RTS
�:
.off
LDA #&B4
PHA
 LDA #&DE
*LDY #&2D
4LDX #&02
>BNE vectors
H:
RQ\intercept oswrch to get number of screen rows a detokenised line will occupy
\.count_char
fPHA
pLDA count_flag
zBNE no_count
�PLA
�
LDA count
�
CMP width
�BNE inc_ok
�
LDA #0
�
STA count
�INC rows
�.inc_ok
�
INC count
�
.no_print
�RTS
�
.no_count
�PLA
JMP !wrchv
:
.scroll_chk
$PHA
.TYA
8PHA
B\remove leading spaces
LJSR no_spaces
V
\� token?
`CMP #&86
jBEQ line_tkn
t
\� token?
~CMP #&87
�BNE exit
�JSR off
�BRK
�EQUB 99
�EQUS "Disabled"
�BRK
�:
�
.line_tkn
�JSR no_spaces
�\CR or number token?
�CMP #&0D
�BEQ first_line
CMP #&8D

BEQ get_line
:
	.exit
(PLA
2TAY
<PLA
F
JMP !brkv
P:
Z.first_line
dJSR page_line
nBPL set_screen \always
x:
�
.get_line
�DEC ptra_index
�JSR decode
�JSR get_addr
�JSR top_test
�:
�.set_screen
�\preserve initial line addr
�LDA lineaddr
�STA oldaddr
�LDA lineaddr+1
�STA oldaddr+1
�\set non_paged mode
LDA #&0F
JSR oswrch
2\screen flag used when listing first screenful
"
LDX #0
,STX scr_flag
6\get window width
@LDA wind_rt
JSEC
TSBC wind_lft
^
STA width
h
INC width
r\�
|LDA #&0C
�JSR oswrch
�\�TAB halfway down screen
�LDA #&1F
�JSR oswrch
�
LDA #0
�JSR oswrch
�LDA wind_bot
�SEC
�SBC wind_top
�	LSR A
�JSR oswrch
�JMP into_forwards
�:

.forwards
=\cursor beside line num; must be underneath for next line
LDA #&0A
&
JSR curs2
0JSR inc_lineaddr
:.into_forwards
D2\get number of rows line will occupy on screen
NJSR get_rows
XBNE to_screen \always
b.backwards
lJSR dec_line_addr
vJSR get_rows
�
JSR curs1
�.to_screen
�JSR list
�\preserve vpos
�LDX vpos
�!\cursor up beside line number
�
JSR curs1
�:
�\list screenful
�LDA scr_flag
�BMI up_again
�BNE down
�LDA vpos
CMP wind_top
BNE backwards
INC scr_flag
 	.down
*CPX wind_bot
4BNE forwards
>DEC scr_flag
HDEC scr_flag
R
.up_again
\CMP #&FE
fBEQ main_loop
pLDA oldaddr
zCMP lineaddr
�BNE backwards
�LDA oldaddr+1
�CMP lineaddr+1
�BNE backwards
�DEC scr_flag
�:
�$\in main loop, scroll up or down
�.main_loop
�LDX &FF
�BMI escape
�
\CTRL?
�LDX #&FE
�JSR inkeys
	BCS backwards
	\SHIFT?
	LDX #&FF
	$JSR inkeys
	.BCS forwards
	8BCC main_loop
	B:
	L.inc_lineaddr
	V
LDY #3
	`LDA (lineaddr),Y
	jCLC
	tADC lineaddr
	~STA lineaddr
	�BCC top_test
	�INC lineaddr+1
	�
.top_test
	�
LDY #1
	�LDA (lineaddr),Y
	�BPL not_top
	�.page_line
	�
LDY #0
	�STY lineaddr
	�LDA page
	�STA lineaddr+1
	�INY
LDA (lineaddr),Y

BPL not_top
\if no prog in mem
.escape
(\cursor to bot of screen
2LDA #&1F
<JSR oswrch
F
LDA #0
PJSR oswrch
ZLDA wind_bot
dJSR oswrch
nBRK
xBRK
�EQUS "Escape"
�BRK
�:
�
.get_rows
�LDY #&FF
�
STY count
�INY
�STY count_flag
�STY rows
�JSR list
�INC count_flag
�.not_top
�RTS
:

.get_addr
JSR linesrch
"X\if line found, (&3D;&3E) points to CR+3; else points to CR at start of next line...
,LDX &3D
6LDY &3E
@BCS not_found
JDEX
TDEX
^DEX
hCPX #&FD
rBCC not_found
|DEY
�.not_found
�STX lineaddr
�STY lineaddr+1
�RTS
�:
�.back_to_top
�\carry set always
�LDA top
�
SBC #2
�STA lineaddr
�
LDA top+1
�
SBC #0
�STA lineaddr+1
.dec_line_addr

LDY #0
STY temp
&LDA page
0STA temp+1
:.decla1
DLDA temp+1
NCMP lineaddr+1
XBEQ decla3
b.decla2
lLDA temp
vSTA previous_line
�
LDY #3
�ADC (temp),Y
�STA temp
�LDA temp+1
�STA previous_line+1
�BCC decla1
�INC temp+1
�BCS decla1
�.decla3
�LDA temp
�CMP lineaddr
�BNE decla2
�TYA

BEQ back_to_top

LDA previous_line

STA lineaddr

 LDA previous_line+1

*STA lineaddr+1

4RTS

>:

H	.list

R
LDY #1

\LDA (lineaddr),Y

fSTA inta+1

pINY

zLDA (lineaddr),Y

�STA inta

�JSR print_num5

�
LDY #3

�
LDA listo

�BEQ list_loop

�LDA #&20

�JSR oswrch

�.list_loop

�INY

�.list_loop2

�LDA (lineaddr),Y

�CMP #&8D

�BEQ linetkn
CMP #&0D
BEQ endlist
JSR print_tkn
$JMP list_loop
..endlist
8JMP osnewl
B.linetkn
LSTY ptra_index
VJSR decode
`TYA
jPHA
tJSR print_num0
~PLA
�TAY
�JMP list_loop2
�:
�.inkeys
�LDY #&FF
�LDA #&81
�JMP osbyte
�:
�
.curs1
�LDA #&0B
�
.curs2
�LDY rows
INY

.curs_loop
JSR oswrch
DEY
(BNE curs_loop
2RTS
<	]:�:�
F:
P� �error
Z�
d� �=17 �" at line ";�:�
n;�":"':$&700="LIST"+Þ:$&710=$&8AF6:!&718=&8B0B4C:� &710
�
00000000  0d 00 0a 23 f4 20 42 61  63 6b 77 61 72 64 73 20  |...#. Backwards |
00000010  61 6e 64 20 66 6f 72 77  61 72 64 73 20 6c 69 73  |and forwards lis|
00000020  74 65 72 0d 00 14 16 f4  20 42 79 20 4a 6f 68 6e  |ter..... By John|
00000030  20 47 65 72 61 67 68 74  79 0d 00 1e 05 3a 0d 00  | Geraghty....:..|
00000040  28 05 3a 0d 00 32 0e ee  20 85 20 f2 65 72 72 6f  |(.:..2.. . .erro|
00000050  72 0d 00 3c 06 eb 36 0d  00 46 0d f2 61 73 73 65  |r..<..6..F..asse|
00000060  6d 62 6c 65 0d 00 50 11  f1 27 22 53 61 76 69 6e  |mble..P..'"Savin|
00000070  67 2e 2e 2e 22 0d 00 5a  24 ff 22 53 41 56 45 20  |g..."..Z$."SAVE |
00000080  42 4c 49 53 54 22 2b bd  33 32 2b 22 42 30 30 22  |BLIST"+.32+"B00"|
00000090  2b bd 33 32 2b c3 7e 50  25 0d 00 64 0f d6 20 69  |+.32+.~P%..d.. i|
000000a0  6e 74 65 72 63 65 70 74  0d 00 6e 45 f1 27 27 22  |ntercept..nE.''"|
000000b0  50 72 65 73 73 20 52 65  74 75 72 6e 2c 20 74 68  |Press Return, th|
000000c0  65 6e 20 75 73 65 22 27  22 43 54 52 4c 20 61 6e  |en use"'"CTRL an|
000000d0  64 20 53 48 49 46 54 20  74 6f 20 73 63 72 6f 6c  |d SHIFT to scrol|
000000e0  6c 20 6c 69 73 74 69 6e  67 2e 2e 2e 22 0d 00 78  |l listing..."..x|
000000f0  09 2a 46 58 31 35 0d 00  82 0c f5 20 fd 20 a5 3d  |.*FX15..... . .=|
00000100  31 33 0d 00 8c 13 3f 26  31 46 3d 31 3a f4 20 4c  |13....?&1F=1:. L|
00000110  49 53 54 4f 31 0d 00 96  0a 86 20 8d 54 70 42 0d  |ISTO1..... .TpB.|
00000120  00 a0 05 e0 0d 00 aa 05  3a 0d 00 b4 0f dd 20 f2  |........:..... .|
00000130  61 73 73 65 6d 62 6c 65  0d 00 be 16 e7 20 3f 26  |assemble..... ?&|
00000140  32 30 46 3c 26 43 30 20  d6 20 26 42 31 39 0d 00  |20F<&C0 . &B19..|
00000150  c8 0c 74 65 6d 70 3d 26  37 30 0d 00 d2 10 73 63  |..temp=&70....sc|
00000160  72 5f 66 6c 61 67 3d 26  37 32 0d 00 dc 12 63 6f  |r_flag=&72....co|
00000170  75 6e 74 5f 66 6c 61 67  3d 26 37 34 0d 00 e6 0f  |unt_flag=&74....|
00000180  6f 6c 64 61 64 64 72 3d  26 37 35 0d 00 f0 0d 63  |oldaddr=&75....c|
00000190  6f 75 6e 74 3d 26 37 37  0d 00 fa 0c 72 6f 77 73  |ount=&77....rows|
000001a0  3d 26 37 38 0d 01 04 15  70 72 65 76 69 6f 75 73  |=&78....previous|
000001b0  5f 6c 69 6e 65 3d 26 37  41 0d 01 0e 0d 77 69 64  |_line=&7A....wid|
000001c0  74 68 3d 26 37 43 0d 01  18 05 3a 0d 01 22 12 70  |th=&7C....:..".p|
000001d0  74 72 61 5f 69 6e 64 65  78 3d 26 30 41 0d 01 2c  |tra_index=&0A..,|
000001e0  17 6c 69 6e 65 61 64 64  72 3d 26 30 42 3a f4 3d  |.lineaddr=&0B:.=|
000001f0  70 74 72 61 0d 01 36 0b  74 6f 70 3d 26 31 32 0d  |ptra..6.top=&12.|
00000200  01 40 0c 70 61 67 65 3d  26 31 38 0d 01 4a 0d 6c  |.@.page=&18..J.l|
00000210  69 73 74 6f 3d 26 31 46  0d 01 54 0c 69 6e 74 61  |isto=&1F..T.inta|
00000220  3d 26 32 41 0d 01 5e 0d  62 72 6b 76 3d 26 32 30  |=&2A..^.brkv=&20|
00000230  32 0d 01 68 0e 77 72 63  68 76 3d 26 32 30 45 0d  |2..h.wrchv=&20E.|
00000240  01 72 0c 70 6f 73 3d 26  33 31 38 0d 01 7c 0d 76  |.r.pos=&318..|.v|
00000250  70 6f 73 3d 26 33 31 39  0d 01 86 10 77 69 6e 64  |pos=&319....wind|
00000260  5f 72 74 3d 26 33 30 41  0d 01 90 11 77 69 6e 64  |_rt=&30A....wind|
00000270  5f 6c 66 74 3d 26 33 30  38 0d 01 9a 11 77 69 6e  |_lft=&308....win|
00000280  64 5f 62 6f 74 3d 26 33  30 39 0d 01 a4 11 77 69  |d_bot=&309....wi|
00000290  6e 64 5f 74 6f 70 3d 26  33 30 42 0d 01 ae 05 3a  |nd_top=&30B....:|
000002a0  0d 01 b8 10 6f 73 6e 65  77 6c 3d 26 46 46 45 37  |....osnewl=&FFE7|
000002b0  0d 01 c2 10 6f 73 77 72  63 68 3d 26 46 46 45 45  |....oswrch=&FFEE|
000002c0  0d 01 cc 10 6f 73 72 64  63 68 3d 26 46 46 45 30  |....osrdch=&FFE0|
000002d0  0d 01 d6 10 6f 73 62 79  74 65 3d 26 46 46 46 34  |....osbyte=&FFF4|
000002e0  0d 01 e0 05 3a 0d 01 ea  0f 62 61 73 69 63 3d 26  |....:....basic=&|
000002f0  38 41 46 33 0d 01 f4 13  6e 6f 5f 73 70 61 63 65  |8AF3....no_space|
00000300  73 3d 26 38 41 39 37 0d  01 fe 10 64 65 63 6f 64  |s=&8A97....decod|
00000310  65 3d 26 39 37 44 46 0d  02 08 14 70 72 69 6e 74  |e=&97DF....print|
00000320  5f 6e 75 6d 35 3d 26 39  39 32 33 0d 02 12 14 70  |_num5=&9923....p|
00000330  72 69 6e 74 5f 6e 75 6d  30 3d 26 39 39 31 46 0d  |rint_num0=&991F.|
00000340  02 1c 12 6c 69 6e 65 73  72 63 68 3d 26 39 39 37  |...linesrch=&997|
00000350  30 0d 02 26 13 70 72 69  6e 74 5f 74 6b 6e 3d 26  |0..&.print_tkn=&|
00000360  42 35 30 45 0d 02 30 05  3a 0d 02 3a 13 e3 20 70  |B50E..0.:..:.. p|
00000370  61 73 73 3d 30 20 b8 20  32 20 88 32 0d 02 44 0b  |ass=0 . 2 .2..D.|
00000380  50 25 3d 26 42 30 30 0d  02 4e 0d 5b 4f 50 54 20  |P%=&B00..N.[OPT |
00000390  70 61 73 73 0d 02 58 0e  2e 69 6e 74 65 72 63 65  |pass..X..interce|
000003a0  70 74 0d 02 62 19 4c 44  41 20 23 63 6f 75 6e 74  |pt..b.LDA #count|
000003b0  5f 63 68 61 72 20 81 26  31 30 30 0d 02 6c 07 50  |_char .&100..l.P|
000003c0  48 41 0d 02 76 19 4c 44  59 20 23 63 6f 75 6e 74  |HA..v.LDY #count|
000003d0  5f 63 68 61 72 20 83 26  31 30 30 0d 02 80 19 4c  |_char .&100....L|
000003e0  44 58 20 23 73 63 72 6f  6c 6c 5f 63 68 6b 20 83  |DX #scroll_chk .|
000003f0  26 31 30 30 0d 02 8a 12  53 54 41 20 63 6f 75 6e  |&100....STA coun|
00000400  74 5f 66 6c 61 67 0d 02  94 05 3a 0d 02 9e 0c 2e  |t_flag....:.....|
00000410  76 65 63 74 6f 72 73 0d  02 a8 07 53 45 49 0d 02  |vectors....SEI..|
00000420  b2 0f 53 54 41 20 77 72  63 68 76 2b 31 0d 02 bc  |..STA wrchv+1...|
00000430  07 50 4c 41 0d 02 c6 0e  53 54 41 20 62 72 6b 76  |.PLA....STA brkv|
00000440  2b 31 0d 02 d0 0d 53 54  59 20 77 72 63 68 76 0d  |+1....STY wrchv.|
00000450  02 da 0c 53 54 58 20 62  72 6b 76 0d 02 e4 07 43  |...STX brkv....C|
00000460  4c 49 0d 02 ee 07 52 54  53 0d 02 f8 05 3a 0d 03  |LI....RTS....:..|
00000470  02 08 2e 6f 66 66 0d 03  0c 0c 4c 44 41 20 23 26  |...off....LDA #&|
00000480  42 34 0d 03 16 07 50 48  41 0d 03 20 0c 4c 44 41  |B4....PHA.. .LDA|
00000490  20 23 26 44 45 0d 03 2a  0c 4c 44 59 20 23 26 32  | #&DE..*.LDY #&2|
000004a0  44 0d 03 34 0c 4c 44 58  20 23 26 30 32 0d 03 3e  |D..4.LDX #&02..>|
000004b0  0f 42 4e 45 20 76 65 63  74 6f 72 73 0d 03 48 05  |.BNE vectors..H.|
000004c0  3a 0d 03 52 51 5c 69 6e  74 65 72 63 65 70 74 20  |:..RQ\intercept |
000004d0  6f 73 77 72 63 68 20 74  6f 20 67 65 74 20 6e 75  |oswrch to get nu|
000004e0  6d 62 65 72 20 6f 66 20  73 63 72 65 65 6e 20 72  |mber of screen r|
000004f0  6f 77 73 20 61 20 64 65  74 6f 6b 65 6e 69 73 65  |ows a detokenise|
00000500  64 20 6c 69 6e 65 20 77  69 6c 6c 20 6f 63 63 75  |d line will occu|
00000510  70 79 0d 03 5c 0f 2e 63  6f 75 6e 74 5f 63 68 61  |py..\..count_cha|
00000520  72 0d 03 66 07 50 48 41  0d 03 70 12 4c 44 41 20  |r..f.PHA..p.LDA |
00000530  63 6f 75 6e 74 5f 66 6c  61 67 0d 03 7a 10 42 4e  |count_flag..z.BN|
00000540  45 20 6e 6f 5f 63 6f 75  6e 74 0d 03 84 07 50 4c  |E no_count....PL|
00000550  41 0d 03 8e 0d 4c 44 41  20 63 6f 75 6e 74 0d 03  |A....LDA count..|
00000560  98 0d 43 4d 50 20 77 69  64 74 68 0d 03 a2 0e 42  |..CMP width....B|
00000570  4e 45 20 69 6e 63 5f 6f  6b 0d 03 ac 0a 4c 44 41  |NE inc_ok....LDA|
00000580  20 23 30 0d 03 b6 0d 53  54 41 20 63 6f 75 6e 74  | #0....STA count|
00000590  0d 03 c0 0c 49 4e 43 20  72 6f 77 73 0d 03 ca 0b  |....INC rows....|
000005a0  2e 69 6e 63 5f 6f 6b 0d  03 d4 0d 49 4e 43 20 63  |.inc_ok....INC c|
000005b0  6f 75 6e 74 0d 03 de 0d  2e 6e 6f 5f 70 72 69 6e  |ount.....no_prin|
000005c0  74 0d 03 e8 07 52 54 53  0d 03 f2 0d 2e 6e 6f 5f  |t....RTS.....no_|
000005d0  63 6f 75 6e 74 0d 03 fc  07 50 4c 41 0d 04 06 0e  |count....PLA....|
000005e0  4a 4d 50 20 21 77 72 63  68 76 0d 04 10 05 3a 0d  |JMP !wrchv....:.|
000005f0  04 1a 0f 2e 73 63 72 6f  6c 6c 5f 63 68 6b 0d 04  |....scroll_chk..|
00000600  24 07 50 48 41 0d 04 2e  07 54 59 41 0d 04 38 07  |$.PHA....TYA..8.|
00000610  50 48 41 0d 04 42 1a 5c  72 65 6d 6f 76 65 20 6c  |PHA..B.\remove l|
00000620  65 61 64 69 6e 67 20 73  70 61 63 65 73 0d 04 4c  |eading spaces..L|
00000630  11 4a 53 52 20 6e 6f 5f  73 70 61 63 65 73 0d 04  |.JSR no_spaces..|
00000640  56 0d 5c 86 20 74 6f 6b  65 6e 3f 0d 04 60 0c 43  |V.\. token?..`.C|
00000650  4d 50 20 23 26 38 36 0d  04 6a 10 42 45 51 20 6c  |MP #&86..j.BEQ l|
00000660  69 6e 65 5f 74 6b 6e 0d  04 74 0d 5c 87 20 74 6f  |ine_tkn..t.\. to|
00000670  6b 65 6e 3f 0d 04 7e 0c  43 4d 50 20 23 26 38 37  |ken?..~.CMP #&87|
00000680  0d 04 88 0c 42 4e 45 20  65 78 69 74 0d 04 92 0b  |....BNE exit....|
00000690  4a 53 52 20 6f 66 66 0d  04 9c 07 42 52 4b 0d 04  |JSR off....BRK..|
000006a0  a6 0b 45 51 55 42 20 39  39 0d 04 b0 13 45 51 55  |..EQUB 99....EQU|
000006b0  53 20 22 44 69 73 61 62  6c 65 64 22 0d 04 ba 07  |S "Disabled"....|
000006c0  42 52 4b 0d 04 c4 05 3a  0d 04 ce 0d 2e 6c 69 6e  |BRK....:.....lin|
000006d0  65 5f 74 6b 6e 0d 04 d8  11 4a 53 52 20 6e 6f 5f  |e_tkn....JSR no_|
000006e0  73 70 61 63 65 73 0d 04  e2 18 5c 43 52 20 6f 72  |spaces....\CR or|
000006f0  20 6e 75 6d 62 65 72 20  74 6f 6b 65 6e 3f 0d 04  | number token?..|
00000700  ec 0c 43 4d 50 20 23 26  30 44 0d 04 f6 12 42 45  |..CMP #&0D....BE|
00000710  51 20 66 69 72 73 74 5f  6c 69 6e 65 0d 05 00 0c  |Q first_line....|
00000720  43 4d 50 20 23 26 38 44  0d 05 0a 10 42 45 51 20  |CMP #&8D....BEQ |
00000730  67 65 74 5f 6c 69 6e 65  0d 05 14 05 3a 0d 05 1e  |get_line....:...|
00000740  09 2e 65 78 69 74 0d 05  28 07 50 4c 41 0d 05 32  |..exit..(.PLA..2|
00000750  07 54 41 59 0d 05 3c 07  50 4c 41 0d 05 46 0d 4a  |.TAY..<.PLA..F.J|
00000760  4d 50 20 21 62 72 6b 76  0d 05 50 05 3a 0d 05 5a  |MP !brkv..P.:..Z|
00000770  0f 2e 66 69 72 73 74 5f  6c 69 6e 65 0d 05 64 11  |..first_line..d.|
00000780  4a 53 52 20 70 61 67 65  5f 6c 69 6e 65 0d 05 6e  |JSR page_line..n|
00000790  1a 42 50 4c 20 73 65 74  5f 73 63 72 65 65 6e 20  |.BPL set_screen |
000007a0  5c 61 6c 77 61 79 73 0d  05 78 05 3a 0d 05 82 0d  |\always..x.:....|
000007b0  2e 67 65 74 5f 6c 69 6e  65 0d 05 8c 12 44 45 43  |.get_line....DEC|
000007c0  20 70 74 72 61 5f 69 6e  64 65 78 0d 05 96 0e 4a  | ptra_index....J|
000007d0  53 52 20 64 65 63 6f 64  65 0d 05 a0 10 4a 53 52  |SR decode....JSR|
000007e0  20 67 65 74 5f 61 64 64  72 0d 05 aa 10 4a 53 52  | get_addr....JSR|
000007f0  20 74 6f 70 5f 74 65 73  74 0d 05 b4 05 3a 0d 05  | top_test....:..|
00000800  be 0f 2e 73 65 74 5f 73  63 72 65 65 6e 0d 05 c8  |...set_screen...|
00000810  1f 5c 70 72 65 73 65 72  76 65 20 69 6e 69 74 69  |.\preserve initi|
00000820  61 6c 20 6c 69 6e 65 20  61 64 64 72 0d 05 d2 10  |al line addr....|
00000830  4c 44 41 20 6c 69 6e 65  61 64 64 72 0d 05 dc 0f  |LDA lineaddr....|
00000840  53 54 41 20 6f 6c 64 61  64 64 72 0d 05 e6 12 4c  |STA oldaddr....L|
00000850  44 41 20 6c 69 6e 65 61  64 64 72 2b 31 0d 05 f0  |DA lineaddr+1...|
00000860  11 53 54 41 20 6f 6c 64  61 64 64 72 2b 31 0d 05  |.STA oldaddr+1..|
00000870  fa 17 5c 73 65 74 20 6e  6f 6e 5f 70 61 67 65 64  |..\set non_paged|
00000880  20 6d 6f 64 65 0d 06 04  0c 4c 44 41 20 23 26 30  | mode....LDA #&0|
00000890  46 0d 06 0e 0e 4a 53 52  20 6f 73 77 72 63 68 0d  |F....JSR oswrch.|
000008a0  06 18 32 5c 73 63 72 65  65 6e 20 66 6c 61 67 20  |..2\screen flag |
000008b0  75 73 65 64 20 77 68 65  6e 20 6c 69 73 74 69 6e  |used when listin|
000008c0  67 20 66 69 72 73 74 20  73 63 72 65 65 6e 66 75  |g first screenfu|
000008d0  6c 0d 06 22 0a 4c 44 58  20 23 30 0d 06 2c 10 53  |l..".LDX #0..,.S|
000008e0  54 58 20 73 63 72 5f 66  6c 61 67 0d 06 36 15 5c  |TX scr_flag..6.\|
000008f0  67 65 74 20 77 69 6e 64  6f 77 20 77 69 64 74 68  |get window width|
00000900  0d 06 40 0f 4c 44 41 20  77 69 6e 64 5f 72 74 0d  |..@.LDA wind_rt.|
00000910  06 4a 07 53 45 43 0d 06  54 10 53 42 43 20 77 69  |.J.SEC..T.SBC wi|
00000920  6e 64 5f 6c 66 74 0d 06  5e 0d 53 54 41 20 77 69  |nd_lft..^.STA wi|
00000930  64 74 68 0d 06 68 0d 49  4e 43 20 77 69 64 74 68  |dth..h.INC width|
00000940  0d 06 72 06 5c db 0d 06  7c 0c 4c 44 41 20 23 26  |..r.\...|.LDA #&|
00000950  30 43 0d 06 86 0e 4a 53  52 20 6f 73 77 72 63 68  |0C....JSR oswrch|
00000960  0d 06 90 1d 5c f1 54 41  42 20 68 61 6c 66 77 61  |....\.TAB halfwa|
00000970  79 20 64 6f 77 6e 20 73  63 72 65 65 6e 0d 06 9a  |y down screen...|
00000980  0c 4c 44 41 20 23 26 31  46 0d 06 a4 0e 4a 53 52  |.LDA #&1F....JSR|
00000990  20 6f 73 77 72 63 68 0d  06 ae 0a 4c 44 41 20 23  | oswrch....LDA #|
000009a0  30 0d 06 b8 0e 4a 53 52  20 6f 73 77 72 63 68 0d  |0....JSR oswrch.|
000009b0  06 c2 10 4c 44 41 20 77  69 6e 64 5f 62 6f 74 0d  |...LDA wind_bot.|
000009c0  06 cc 07 53 45 43 0d 06  d6 10 53 42 43 20 77 69  |...SEC....SBC wi|
000009d0  6e 64 5f 74 6f 70 0d 06  e0 09 4c 53 52 20 41 0d  |nd_top....LSR A.|
000009e0  06 ea 0e 4a 53 52 20 6f  73 77 72 63 68 0d 06 f4  |...JSR oswrch...|
000009f0  15 4a 4d 50 20 69 6e 74  6f 5f 66 6f 72 77 61 72  |.JMP into_forwar|
00000a00  64 73 0d 06 fe 05 3a 0d  07 08 0d 2e 66 6f 72 77  |ds....:.....forw|
00000a10  61 72 64 73 0d 07 12 3d  5c 63 75 72 73 6f 72 20  |ards...=\cursor |
00000a20  62 65 73 69 64 65 20 6c  69 6e 65 20 6e 75 6d 3b  |beside line num;|
00000a30  20 6d 75 73 74 20 62 65  20 75 6e 64 65 72 6e 65  | must be underne|
00000a40  61 74 68 20 66 6f 72 20  6e 65 78 74 20 6c 69 6e  |ath for next lin|
00000a50  65 0d 07 1c 0c 4c 44 41  20 23 26 30 41 0d 07 26  |e....LDA #&0A..&|
00000a60  0d 4a 53 52 20 63 75 72  73 32 0d 07 30 14 4a 53  |.JSR curs2..0.JS|
00000a70  52 20 69 6e 63 5f 6c 69  6e 65 61 64 64 72 0d 07  |R inc_lineaddr..|
00000a80  3a 12 2e 69 6e 74 6f 5f  66 6f 72 77 61 72 64 73  |:..into_forwards|
00000a90  0d 07 44 32 5c 67 65 74  20 6e 75 6d 62 65 72 20  |..D2\get number |
00000aa0  6f 66 20 72 6f 77 73 20  6c 69 6e 65 20 77 69 6c  |of rows line wil|
00000ab0  6c 20 6f 63 63 75 70 79  20 6f 6e 20 73 63 72 65  |l occupy on scre|
00000ac0  65 6e 0d 07 4e 10 4a 53  52 20 67 65 74 5f 72 6f  |en..N.JSR get_ro|
00000ad0  77 73 0d 07 58 19 42 4e  45 20 74 6f 5f 73 63 72  |ws..X.BNE to_scr|
00000ae0  65 65 6e 20 5c 61 6c 77  61 79 73 0d 07 62 0e 2e  |een \always..b..|
00000af0  62 61 63 6b 77 61 72 64  73 0d 07 6c 15 4a 53 52  |backwards..l.JSR|
00000b00  20 64 65 63 5f 6c 69 6e  65 5f 61 64 64 72 0d 07  | dec_line_addr..|
00000b10  76 10 4a 53 52 20 67 65  74 5f 72 6f 77 73 0d 07  |v.JSR get_rows..|
00000b20  80 0d 4a 53 52 20 63 75  72 73 31 0d 07 8a 0e 2e  |..JSR curs1.....|
00000b30  74 6f 5f 73 63 72 65 65  6e 0d 07 94 0c 4a 53 52  |to_screen....JSR|
00000b40  20 6c 69 73 74 0d 07 9e  12 5c 70 72 65 73 65 72  | list....\preser|
00000b50  76 65 20 76 70 6f 73 0d  07 a8 0c 4c 44 58 20 76  |ve vpos....LDX v|
00000b60  70 6f 73 0d 07 b2 21 5c  63 75 72 73 6f 72 20 75  |pos...!\cursor u|
00000b70  70 20 62 65 73 69 64 65  20 6c 69 6e 65 20 6e 75  |p beside line nu|
00000b80  6d 62 65 72 0d 07 bc 0d  4a 53 52 20 63 75 72 73  |mber....JSR curs|
00000b90  31 0d 07 c6 05 3a 0d 07  d0 13 5c 6c 69 73 74 20  |1....:....\list |
00000ba0  73 63 72 65 65 6e 66 75  6c 0d 07 da 10 4c 44 41  |screenful....LDA|
00000bb0  20 73 63 72 5f 66 6c 61  67 0d 07 e4 10 42 4d 49  | scr_flag....BMI|
00000bc0  20 75 70 5f 61 67 61 69  6e 0d 07 ee 0c 42 4e 45  | up_again....BNE|
00000bd0  20 64 6f 77 6e 0d 07 f8  0c 4c 44 41 20 76 70 6f  | down....LDA vpo|
00000be0  73 0d 08 02 10 43 4d 50  20 77 69 6e 64 5f 74 6f  |s....CMP wind_to|
00000bf0  70 0d 08 0c 11 42 4e 45  20 62 61 63 6b 77 61 72  |p....BNE backwar|
00000c00  64 73 0d 08 16 10 49 4e  43 20 73 63 72 5f 66 6c  |ds....INC scr_fl|
00000c10  61 67 0d 08 20 09 2e 64  6f 77 6e 0d 08 2a 10 43  |ag.. ..down..*.C|
00000c20  50 58 20 77 69 6e 64 5f  62 6f 74 0d 08 34 10 42  |PX wind_bot..4.B|
00000c30  4e 45 20 66 6f 72 77 61  72 64 73 0d 08 3e 10 44  |NE forwards..>.D|
00000c40  45 43 20 73 63 72 5f 66  6c 61 67 0d 08 48 10 44  |EC scr_flag..H.D|
00000c50  45 43 20 73 63 72 5f 66  6c 61 67 0d 08 52 0d 2e  |EC scr_flag..R..|
00000c60  75 70 5f 61 67 61 69 6e  0d 08 5c 0c 43 4d 50 20  |up_again..\.CMP |
00000c70  23 26 46 45 0d 08 66 11  42 45 51 20 6d 61 69 6e  |#&FE..f.BEQ main|
00000c80  5f 6c 6f 6f 70 0d 08 70  0f 4c 44 41 20 6f 6c 64  |_loop..p.LDA old|
00000c90  61 64 64 72 0d 08 7a 10  43 4d 50 20 6c 69 6e 65  |addr..z.CMP line|
00000ca0  61 64 64 72 0d 08 84 11  42 4e 45 20 62 61 63 6b  |addr....BNE back|
00000cb0  77 61 72 64 73 0d 08 8e  11 4c 44 41 20 6f 6c 64  |wards....LDA old|
00000cc0  61 64 64 72 2b 31 0d 08  98 12 43 4d 50 20 6c 69  |addr+1....CMP li|
00000cd0  6e 65 61 64 64 72 2b 31  0d 08 a2 11 42 4e 45 20  |neaddr+1....BNE |
00000ce0  62 61 63 6b 77 61 72 64  73 0d 08 ac 10 44 45 43  |backwards....DEC|
00000cf0  20 73 63 72 5f 66 6c 61  67 0d 08 b6 05 3a 0d 08  | scr_flag....:..|
00000d00  c0 24 5c 69 6e 20 6d 61  69 6e 20 6c 6f 6f 70 2c  |.$\in main loop,|
00000d10  20 73 63 72 6f 6c 6c 20  75 70 20 6f 72 20 64 6f  | scroll up or do|
00000d20  77 6e 0d 08 ca 0e 2e 6d  61 69 6e 5f 6c 6f 6f 70  |wn.....main_loop|
00000d30  0d 08 d4 0b 4c 44 58 20  26 46 46 0d 08 de 0e 42  |....LDX &FF....B|
00000d40  4d 49 20 65 73 63 61 70  65 0d 08 e8 0a 5c 43 54  |MI escape....\CT|
00000d50  52 4c 3f 0d 08 f2 0c 4c  44 58 20 23 26 46 45 0d  |RL?....LDX #&FE.|
00000d60  08 fc 0e 4a 53 52 20 69  6e 6b 65 79 73 0d 09 06  |...JSR inkeys...|
00000d70  11 42 43 53 20 62 61 63  6b 77 61 72 64 73 0d 09  |.BCS backwards..|
00000d80  10 0b 5c 53 48 49 46 54  3f 0d 09 1a 0c 4c 44 58  |..\SHIFT?....LDX|
00000d90  20 23 26 46 46 0d 09 24  0e 4a 53 52 20 69 6e 6b  | #&FF..$.JSR ink|
00000da0  65 79 73 0d 09 2e 10 42  43 53 20 66 6f 72 77 61  |eys....BCS forwa|
00000db0  72 64 73 0d 09 38 11 42  43 43 20 6d 61 69 6e 5f  |rds..8.BCC main_|
00000dc0  6c 6f 6f 70 0d 09 42 05  3a 0d 09 4c 11 2e 69 6e  |loop..B.:..L..in|
00000dd0  63 5f 6c 69 6e 65 61 64  64 72 0d 09 56 0a 4c 44  |c_lineaddr..V.LD|
00000de0  59 20 23 33 0d 09 60 14  4c 44 41 20 28 6c 69 6e  |Y #3..`.LDA (lin|
00000df0  65 61 64 64 72 29 2c 59  0d 09 6a 07 43 4c 43 0d  |eaddr),Y..j.CLC.|
00000e00  09 74 10 41 44 43 20 6c  69 6e 65 61 64 64 72 0d  |.t.ADC lineaddr.|
00000e10  09 7e 10 53 54 41 20 6c  69 6e 65 61 64 64 72 0d  |.~.STA lineaddr.|
00000e20  09 88 10 42 43 43 20 74  6f 70 5f 74 65 73 74 0d  |...BCC top_test.|
00000e30  09 92 12 49 4e 43 20 6c  69 6e 65 61 64 64 72 2b  |...INC lineaddr+|
00000e40  31 0d 09 9c 0d 2e 74 6f  70 5f 74 65 73 74 0d 09  |1.....top_test..|
00000e50  a6 0a 4c 44 59 20 23 31  0d 09 b0 14 4c 44 41 20  |..LDY #1....LDA |
00000e60  28 6c 69 6e 65 61 64 64  72 29 2c 59 0d 09 ba 0f  |(lineaddr),Y....|
00000e70  42 50 4c 20 6e 6f 74 5f  74 6f 70 0d 09 c4 0e 2e  |BPL not_top.....|
00000e80  70 61 67 65 5f 6c 69 6e  65 0d 09 ce 0a 4c 44 59  |page_line....LDY|
00000e90  20 23 30 0d 09 d8 10 53  54 59 20 6c 69 6e 65 61  | #0....STY linea|
00000ea0  64 64 72 0d 09 e2 0c 4c  44 41 20 70 61 67 65 0d  |ddr....LDA page.|
00000eb0  09 ec 12 53 54 41 20 6c  69 6e 65 61 64 64 72 2b  |...STA lineaddr+|
00000ec0  31 0d 09 f6 07 49 4e 59  0d 0a 00 14 4c 44 41 20  |1....INY....LDA |
00000ed0  28 6c 69 6e 65 61 64 64  72 29 2c 59 0d 0a 0a 0f  |(lineaddr),Y....|
00000ee0  42 50 4c 20 6e 6f 74 5f  74 6f 70 0d 0a 14 16 5c  |BPL not_top....\|
00000ef0  69 66 20 6e 6f 20 70 72  6f 67 20 69 6e 20 6d 65  |if no prog in me|
00000f00  6d 0d 0a 1e 0b 2e 65 73  63 61 70 65 0d 0a 28 1c  |m.....escape..(.|
00000f10  5c 63 75 72 73 6f 72 20  74 6f 20 62 6f 74 20 6f  |\cursor to bot o|
00000f20  66 20 73 63 72 65 65 6e  0d 0a 32 0c 4c 44 41 20  |f screen..2.LDA |
00000f30  23 26 31 46 0d 0a 3c 0e  4a 53 52 20 6f 73 77 72  |#&1F..<.JSR oswr|
00000f40  63 68 0d 0a 46 0a 4c 44  41 20 23 30 0d 0a 50 0e  |ch..F.LDA #0..P.|
00000f50  4a 53 52 20 6f 73 77 72  63 68 0d 0a 5a 10 4c 44  |JSR oswrch..Z.LD|
00000f60  41 20 77 69 6e 64 5f 62  6f 74 0d 0a 64 0e 4a 53  |A wind_bot..d.JS|
00000f70  52 20 6f 73 77 72 63 68  0d 0a 6e 07 42 52 4b 0d  |R oswrch..n.BRK.|
00000f80  0a 78 07 42 52 4b 0d 0a  82 11 45 51 55 53 20 22  |.x.BRK....EQUS "|
00000f90  45 73 63 61 70 65 22 0d  0a 8c 07 42 52 4b 0d 0a  |Escape"....BRK..|
00000fa0  96 05 3a 0d 0a a0 0d 2e  67 65 74 5f 72 6f 77 73  |..:.....get_rows|
00000fb0  0d 0a aa 0c 4c 44 59 20  23 26 46 46 0d 0a b4 0d  |....LDY #&FF....|
00000fc0  53 54 59 20 63 6f 75 6e  74 0d 0a be 07 49 4e 59  |STY count....INY|
00000fd0  0d 0a c8 12 53 54 59 20  63 6f 75 6e 74 5f 66 6c  |....STY count_fl|
00000fe0  61 67 0d 0a d2 0c 53 54  59 20 72 6f 77 73 0d 0a  |ag....STY rows..|
00000ff0  dc 0c 4a 53 52 20 6c 69  73 74 0d 0a e6 12 49 4e  |..JSR list....IN|
00001000  43 20 63 6f 75 6e 74 5f  66 6c 61 67 0d 0a f0 0c  |C count_flag....|
00001010  2e 6e 6f 74 5f 74 6f 70  0d 0a fa 07 52 54 53 0d  |.not_top....RTS.|
00001020  0b 04 05 3a 0d 0b 0e 0d  2e 67 65 74 5f 61 64 64  |...:.....get_add|
00001030  72 0d 0b 18 10 4a 53 52  20 6c 69 6e 65 73 72 63  |r....JSR linesrc|
00001040  68 0d 0b 22 58 5c 69 66  20 6c 69 6e 65 20 66 6f  |h.."X\if line fo|
00001050  75 6e 64 2c 20 28 26 33  44 3b 26 33 45 29 20 70  |und, (&3D;&3E) p|
00001060  6f 69 6e 74 73 20 74 6f  20 43 52 2b 33 3b 20 65  |oints to CR+3; e|
00001070  6c 73 65 20 70 6f 69 6e  74 73 20 74 6f 20 43 52  |lse points to CR|
00001080  20 61 74 20 73 74 61 72  74 20 6f 66 20 6e 65 78  | at start of nex|
00001090  74 20 6c 69 6e 65 2e 2e  2e 0d 0b 2c 0b 4c 44 58  |t line.....,.LDX|
000010a0  20 26 33 44 0d 0b 36 0b  4c 44 59 20 26 33 45 0d  | &3D..6.LDY &3E.|
000010b0  0b 40 11 42 43 53 20 6e  6f 74 5f 66 6f 75 6e 64  |.@.BCS not_found|
000010c0  0d 0b 4a 07 44 45 58 0d  0b 54 07 44 45 58 0d 0b  |..J.DEX..T.DEX..|
000010d0  5e 07 44 45 58 0d 0b 68  0c 43 50 58 20 23 26 46  |^.DEX..h.CPX #&F|
000010e0  44 0d 0b 72 11 42 43 43  20 6e 6f 74 5f 66 6f 75  |D..r.BCC not_fou|
000010f0  6e 64 0d 0b 7c 07 44 45  59 0d 0b 86 0e 2e 6e 6f  |nd..|.DEY.....no|
00001100  74 5f 66 6f 75 6e 64 0d  0b 90 10 53 54 58 20 6c  |t_found....STX l|
00001110  69 6e 65 61 64 64 72 0d  0b 9a 12 53 54 59 20 6c  |ineaddr....STY l|
00001120  69 6e 65 61 64 64 72 2b  31 0d 0b a4 07 52 54 53  |ineaddr+1....RTS|
00001130  0d 0b ae 05 3a 0d 0b b8  10 2e 62 61 63 6b 5f 74  |....:.....back_t|
00001140  6f 5f 74 6f 70 0d 0b c2  15 5c 63 61 72 72 79 20  |o_top....\carry |
00001150  73 65 74 20 61 6c 77 61  79 73 0d 0b cc 0b 4c 44  |set always....LD|
00001160  41 20 74 6f 70 0d 0b d6  0a 53 42 43 20 23 32 0d  |A top....SBC #2.|
00001170  0b e0 10 53 54 41 20 6c  69 6e 65 61 64 64 72 0d  |...STA lineaddr.|
00001180  0b ea 0d 4c 44 41 20 74  6f 70 2b 31 0d 0b f4 0a  |...LDA top+1....|
00001190  53 42 43 20 23 30 0d 0b  fe 12 53 54 41 20 6c 69  |SBC #0....STA li|
000011a0  6e 65 61 64 64 72 2b 31  0d 0c 08 12 2e 64 65 63  |neaddr+1.....dec|
000011b0  5f 6c 69 6e 65 5f 61 64  64 72 0d 0c 12 0a 4c 44  |_line_addr....LD|
000011c0  59 20 23 30 0d 0c 1c 0c  53 54 59 20 74 65 6d 70  |Y #0....STY temp|
000011d0  0d 0c 26 0c 4c 44 41 20  70 61 67 65 0d 0c 30 0e  |..&.LDA page..0.|
000011e0  53 54 41 20 74 65 6d 70  2b 31 0d 0c 3a 0b 2e 64  |STA temp+1..:..d|
000011f0  65 63 6c 61 31 0d 0c 44  0e 4c 44 41 20 74 65 6d  |ecla1..D.LDA tem|
00001200  70 2b 31 0d 0c 4e 12 43  4d 50 20 6c 69 6e 65 61  |p+1..N.CMP linea|
00001210  64 64 72 2b 31 0d 0c 58  0e 42 45 51 20 64 65 63  |ddr+1..X.BEQ dec|
00001220  6c 61 33 0d 0c 62 0b 2e  64 65 63 6c 61 32 0d 0c  |la3..b..decla2..|
00001230  6c 0c 4c 44 41 20 74 65  6d 70 0d 0c 76 15 53 54  |l.LDA temp..v.ST|
00001240  41 20 70 72 65 76 69 6f  75 73 5f 6c 69 6e 65 0d  |A previous_line.|
00001250  0c 80 0a 4c 44 59 20 23  33 0d 0c 8a 10 41 44 43  |...LDY #3....ADC|
00001260  20 28 74 65 6d 70 29 2c  59 0d 0c 94 0c 53 54 41  | (temp),Y....STA|
00001270  20 74 65 6d 70 0d 0c 9e  0e 4c 44 41 20 74 65 6d  | temp....LDA tem|
00001280  70 2b 31 0d 0c a8 17 53  54 41 20 70 72 65 76 69  |p+1....STA previ|
00001290  6f 75 73 5f 6c 69 6e 65  2b 31 0d 0c b2 0e 42 43  |ous_line+1....BC|
000012a0  43 20 64 65 63 6c 61 31  0d 0c bc 0e 49 4e 43 20  |C decla1....INC |
000012b0  74 65 6d 70 2b 31 0d 0c  c6 0e 42 43 53 20 64 65  |temp+1....BCS de|
000012c0  63 6c 61 31 0d 0c d0 0b  2e 64 65 63 6c 61 33 0d  |cla1.....decla3.|
000012d0  0c da 0c 4c 44 41 20 74  65 6d 70 0d 0c e4 10 43  |...LDA temp....C|
000012e0  4d 50 20 6c 69 6e 65 61  64 64 72 0d 0c ee 0e 42  |MP lineaddr....B|
000012f0  4e 45 20 64 65 63 6c 61  32 0d 0c f8 07 54 59 41  |NE decla2....TYA|
00001300  0d 0d 02 13 42 45 51 20  62 61 63 6b 5f 74 6f 5f  |....BEQ back_to_|
00001310  74 6f 70 0d 0d 0c 15 4c  44 41 20 70 72 65 76 69  |top....LDA previ|
00001320  6f 75 73 5f 6c 69 6e 65  0d 0d 16 10 53 54 41 20  |ous_line....STA |
00001330  6c 69 6e 65 61 64 64 72  0d 0d 20 17 4c 44 41 20  |lineaddr.. .LDA |
00001340  70 72 65 76 69 6f 75 73  5f 6c 69 6e 65 2b 31 0d  |previous_line+1.|
00001350  0d 2a 12 53 54 41 20 6c  69 6e 65 61 64 64 72 2b  |.*.STA lineaddr+|
00001360  31 0d 0d 34 07 52 54 53  0d 0d 3e 05 3a 0d 0d 48  |1..4.RTS..>.:..H|
00001370  09 2e 6c 69 73 74 0d 0d  52 0a 4c 44 59 20 23 31  |..list..R.LDY #1|
00001380  0d 0d 5c 14 4c 44 41 20  28 6c 69 6e 65 61 64 64  |..\.LDA (lineadd|
00001390  72 29 2c 59 0d 0d 66 0e  53 54 41 20 69 6e 74 61  |r),Y..f.STA inta|
000013a0  2b 31 0d 0d 70 07 49 4e  59 0d 0d 7a 14 4c 44 41  |+1..p.INY..z.LDA|
000013b0  20 28 6c 69 6e 65 61 64  64 72 29 2c 59 0d 0d 84  | (lineaddr),Y...|
000013c0  0c 53 54 41 20 69 6e 74  61 0d 0d 8e 12 4a 53 52  |.STA inta....JSR|
000013d0  20 70 72 69 6e 74 5f 6e  75 6d 35 0d 0d 98 0a 4c  | print_num5....L|
000013e0  44 59 20 23 33 0d 0d a2  0d 4c 44 41 20 6c 69 73  |DY #3....LDA lis|
000013f0  74 6f 0d 0d ac 11 42 45  51 20 6c 69 73 74 5f 6c  |to....BEQ list_l|
00001400  6f 6f 70 0d 0d b6 0c 4c  44 41 20 23 26 32 30 0d  |oop....LDA #&20.|
00001410  0d c0 0e 4a 53 52 20 6f  73 77 72 63 68 0d 0d ca  |...JSR oswrch...|
00001420  0e 2e 6c 69 73 74 5f 6c  6f 6f 70 0d 0d d4 07 49  |..list_loop....I|
00001430  4e 59 0d 0d de 0f 2e 6c  69 73 74 5f 6c 6f 6f 70  |NY.....list_loop|
00001440  32 0d 0d e8 14 4c 44 41  20 28 6c 69 6e 65 61 64  |2....LDA (linead|
00001450  64 72 29 2c 59 0d 0d f2  0c 43 4d 50 20 23 26 38  |dr),Y....CMP #&8|
00001460  44 0d 0d fc 0f 42 45 51  20 6c 69 6e 65 74 6b 6e  |D....BEQ linetkn|
00001470  0d 0e 06 0c 43 4d 50 20  23 26 30 44 0d 0e 10 0f  |....CMP #&0D....|
00001480  42 45 51 20 65 6e 64 6c  69 73 74 0d 0e 1a 11 4a  |BEQ endlist....J|
00001490  53 52 20 70 72 69 6e 74  5f 74 6b 6e 0d 0e 24 11  |SR print_tkn..$.|
000014a0  4a 4d 50 20 6c 69 73 74  5f 6c 6f 6f 70 0d 0e 2e  |JMP list_loop...|
000014b0  0c 2e 65 6e 64 6c 69 73  74 0d 0e 38 0e 4a 4d 50  |..endlist..8.JMP|
000014c0  20 6f 73 6e 65 77 6c 0d  0e 42 0c 2e 6c 69 6e 65  | osnewl..B..line|
000014d0  74 6b 6e 0d 0e 4c 12 53  54 59 20 70 74 72 61 5f  |tkn..L.STY ptra_|
000014e0  69 6e 64 65 78 0d 0e 56  0e 4a 53 52 20 64 65 63  |index..V.JSR dec|
000014f0  6f 64 65 0d 0e 60 07 54  59 41 0d 0e 6a 07 50 48  |ode..`.TYA..j.PH|
00001500  41 0d 0e 74 12 4a 53 52  20 70 72 69 6e 74 5f 6e  |A..t.JSR print_n|
00001510  75 6d 30 0d 0e 7e 07 50  4c 41 0d 0e 88 07 54 41  |um0..~.PLA....TA|
00001520  59 0d 0e 92 12 4a 4d 50  20 6c 69 73 74 5f 6c 6f  |Y....JMP list_lo|
00001530  6f 70 32 0d 0e 9c 05 3a  0d 0e a6 0b 2e 69 6e 6b  |op2....:.....ink|
00001540  65 79 73 0d 0e b0 0c 4c  44 59 20 23 26 46 46 0d  |eys....LDY #&FF.|
00001550  0e ba 0c 4c 44 41 20 23  26 38 31 0d 0e c4 0e 4a  |...LDA #&81....J|
00001560  4d 50 20 6f 73 62 79 74  65 0d 0e ce 05 3a 0d 0e  |MP osbyte....:..|
00001570  d8 0a 2e 63 75 72 73 31  0d 0e e2 0c 4c 44 41 20  |...curs1....LDA |
00001580  23 26 30 42 0d 0e ec 0a  2e 63 75 72 73 32 0d 0e  |#&0B.....curs2..|
00001590  f6 0c 4c 44 59 20 72 6f  77 73 0d 0f 00 07 49 4e  |..LDY rows....IN|
000015a0  59 0d 0f 0a 0e 2e 63 75  72 73 5f 6c 6f 6f 70 0d  |Y.....curs_loop.|
000015b0  0f 14 0e 4a 53 52 20 6f  73 77 72 63 68 0d 0f 1e  |...JSR oswrch...|
000015c0  07 44 45 59 0d 0f 28 11  42 4e 45 20 63 75 72 73  |.DEY..(.BNE curs|
000015d0  5f 6c 6f 6f 70 0d 0f 32  07 52 54 53 0d 0f 3c 09  |_loop..2.RTS..<.|
000015e0  5d 3a ed 3a e1 0d 0f 46  05 3a 0d 0f 50 0c dd 20  |]:.:...F.:..P.. |
000015f0  f2 65 72 72 6f 72 0d 0f  5a 05 f6 0d 0f 64 1b e7  |.error..Z....d..|
00001600  20 9f 3d 31 37 20 f1 22  20 61 74 20 6c 69 6e 65  | .=17 ." at line|
00001610  20 22 3b 9e 3a e0 0d 0f  6e 3b f1 22 3a 22 27 3a  | ";.:...n;.":"':|
00001620  24 26 37 30 30 3d 22 4c  49 53 54 22 2b c3 9e 3a  |$&700="LIST"+..:|
00001630  24 26 37 31 30 3d 24 26  38 41 46 36 3a 21 26 37  |$&710=$&8AF6:!&7|
00001640  31 38 3d 26 38 42 30 42  34 43 3a d6 20 26 37 31  |18=&8B0B4C:. &71|
00001650  30 0d ff                                          |0..|
00001653
BSRC.m0
BSRC.m1
BSRC.m2
BSRC.m4
BSRC.m5