Home » CEEFAX disks » telesoftware9.adl » 18-09-88/SECTOR5

18-09-88/SECTOR5

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 » CEEFAX disks » telesoftware9.adl
Filename: 18-09-88/SECTOR5
Read OK:
File size: 1540 bytes
Load address: 0800
Exec address: 8023
File contents
   10REM: SECTOR5
   20DIM mcode &500
   30zeropage=&70
   40oswrch=&FFEE
   50osword=&FFF1
   60osbyte=&FFF4
   70osnewl=&FFE7
   80oswrch=&FFEE
   90osrdch=&FFE0
  100osasci=&FFE3
  110FORpass=4 TO 6 STEP 2
  120O%=mcode
  130P%=PAGE+&100
  140[OPT pass
  150.firstbyte
  160EQUW &FF0D \ OF the BASIC program
  170.start
  180LDA #&0F
  190JSR osasci \ scroll mode
  200LDX #title MOD 256
  210LDY #title DIV 256
  220JSR print \ print title
  230.getdata
  240LDX #drivenum MOD 256
  250LDY #drivenum DIV 256
  260JSR print \ which drive?
  270.whichdrive
  280JSR osrdch
  290BCS escape
  300SEC
  310SBC #ASC("0")
  320BMI whichdrive \ drive 0-3
  330CMP #&04
  340BCS whichdrive \ drive 0-3
  350STA block \ format parameter block
  360STA catblock \ catalogue parameter block
  370ADC #ASC("0")
  380JSR osasci \ print 0, 1, 2 or 3
  390LDX #tracknum MOD 256
  400LDY #tracknum DIV 256
  410JSR print \ 40 or 80 tracks?
  420.whichtrack
  430JSR osrdch
  440BCS escape
  450LDX #&27 \ 40 tracks
  460CMP #ASC("4")
  470BEQ continue
  480CMP #ASC("8")
  490BNE whichtrack
  500LDX #&4F \ 80 tracks
  510.continue
  520STX finish \ store number of tracks
  530JSR osasci \ print "8" or "4"
  540LDA #ASC("0")
  550JSR osasci \ print "0" to make "40" or "80"
  560LDX #ready MOD 256
  570LDY #ready DIV 256
  580JSR print \ ready to format?
  590JSR osrdch
  600BCS escape
  610PHA \ temp store for answer
  620JSR osasci \ print answer
  630JSR osnewl
  640PLA \ pull answer
  650AND #&DF \ upper case
  660CMP #ASC("Y")
  670BNE getdata
  680JSR osnewl
  690LDA #0
  700STA track
  710LDA #&01 \ data size
  720LDX #&10 \ gap 3
  730LDY #&2A \ number of sectors
  740JSR setup
  750LDA #&7F
  760LDX #block MOD 256
  770LDY #block DIV 256
  780JSR osword \ format track 0 ten sectors
  790LDA result \ load result byte
  800BEQ trackzero \ format OK if result = 0
  810.error
  820BRK
  830BRK
  840EQUS "Format error"
  850BRK
  860.escape
  870LDA #&7E
  880JSR osbyte \ acknowledge Escape
  890BRK
  900BRK
  910EQUS "Escape"
  920BRK
  930.trackzero
  940LDA #&7F
  950LDX #catblock MOD 256
  960LDY #catblock DIV 256
  970JSR osword \ store empty catalogue
  980LDA catresult \ check result byte
  990BNE error \ quit if error
 1000JSR printbyte \ print track 00
 1010.loop
 1020LDA &FF \ poll escape flag
 1030BMI escape \ bit 7 set if Escape pressed
 1040INC track \ increment track number
 1050LDA #&02 \ data size
 1060LDX #&4A \ gap 3
 1070LDY #&45 \ number of sectors
 1080JSR setup
 1090LDA #&7F
 1100LDX #block MOD 256
 1110LDY #block DIV 256
 1120JSR osword \ format track with 5 sectors
 1130LDA result \ load result byte
 1140BNE error \ quit if error
 1150LDA track \ load track number
 1160PHA
 1170JSR printbyte \ print track number
 1180PLA
 1190CMP finish \ is that the last track?
 1200BCC loop \ branch if more tracks to format
 1210LDX #another MOD 256
 1220LDY #another DIV 256
 1230JSR print \ another?
 1240JSR osrdch
 1250BCS escape
 1260PHA \ temp store for answer
 1270JSR osasci \ print answer
 1280JSR osnewl
 1290PLA \ pull answer
 1300AND #&DF \ upper case
 1310CMP #ASC("Y")
 1320BNE return
 1330JMP getdata
 1340.setup
 1350STX gap3
 1360STY numsectors
 1370LDX #39
 1380LDY track
 1390STY physical
 1400.setloop
 1410STA table,X
 1420DEX
 1430DEX
 1440DEX
 1450PHA
 1460TYA
 1470STA table,X
 1480PLA
 1490DEX
 1500BPL setloop
 1510.return
 1520RTS
 1530.print
 1540STX zeropage
 1550STY zeropage+1
 1560LDY #0
 1570.printloop
 1580LDA (zeropage),Y
 1590BEQ endprint
 1600JSR osasci
 1610INY
 1620BNE printloop
 1630.endprint
 1640RTS
 1650.printbyte
 1660PHA
 1670LSR A
 1680LSR A
 1690LSR A
 1700LSR A
 1710JSR nybble \ print MS nybble
 1720PLA
 1730JSR nybble \ print LS nybble
 1740LDA #ASC(" ")
 1750JSR oswrch \ print space
 1760JMP oswrch \ print space
 1770.nybble
 1780AND #&0F
 1790SED
 1800CLC
 1810ADC #&90
 1820ADC #&40
 1830CLD
 1840JMP oswrch \ print nybble and return
 1850.block
 1860EQUB &00 \ drive number 0-3
 1870EQUD table \ sector table
 1880EQUB &05 \ 5 parameters
 1890EQUB &63 \ format track
 1900.physical
 1910EQUB &00 \ physical track number 0
 1920.gap3
 1930EQUB &15 \ gap 3
 1940.numsectors
 1950EQUB &2A \ 10 sectors of 256 bytes
 1960EQUB &00 \ gap 5
 1970EQUB &10 \ gap 1
 1980.result
 1990EQUB &00 \ result byte
 2000.table
 2010EQUD &00000000
 2020EQUD &00010000
 2030EQUD &00020000
 2040EQUD &00030000
 2050EQUD &00040000
 2060EQUD &00050000
 2070EQUD &00060000
 2080EQUD &00070000
 2090EQUD &00080000
 2100EQUD &00090000
 2110.catalogue
 2120EQUB &15 \ disc title (disable VDU)
 2130OPT FNfill(7) \ 7 zero bytes
 2140EQUS "!BOOT  $" \ next 8 bytes
 2150OPT FNfill(240) \ end of first sector
 2160OPT FNfill(5) \ start of second sector
 2170EQUB &08 \ number of files * 8
 2180EQUW &0A20 \ 10 sectors and *OPT 4,2
 2190EQUD &00 \ load and exec = &0000
 2200EQUW &0800 \ length = &800 bytes
 2210EQUB &00 \ MS 2 bits of sector number
 2220EQUB &02 \ starting at sector 2
 2230OPT FNfill(240)
 2240.catblock
 2250EQUB &00 \ drive number
 2260EQUD catalogue \ address of buffer
 2270EQUB &03 \ number of parameters
 2280EQUB &4B \ save data multi sector
 2290EQUB &00 \ logical track
 2300EQUB &00 \ start logical sector
 2310EQUB &22 \ 2 sectors of 256 bytes
 2320.catresult
 2330EQUB &00 \ result byte
 2340.title
 2350EQUB &0D
 2360EQUS "5 Sector DFS Format"
 2370EQUB &0D
 2380BRK
 2390.drivenum
 2400EQUB &0D
 2410EQUS "Drive number? (0-3) "
 2420BRK
 2430.tracknum
 2440EQUB &0D
 2450EQUS "40 or 80 tracks? (4/8) "
 2460BRK
 2470.ready
 2480EQUB &0D
 2490EQUS "Ready to format? (Y/N) "
 2500BRK
 2510.another
 2520EQUB &0D
 2530EQUS "Another? (Y/N) "
 2540BRK
 2550.track
 2560EQUB &00 \ physical track number
 2570.finish
 2580EQUB &00 \ last track number
 2590.lastbyte
 2600]
 2610NEXT
 2620INPUT'"Save filename = "filename$
 2630IF filename$ = "" THEN END
 2640*OPT1,2
 2650OSCLI("SAVE "+filename$+" "+STR$~(mcode)+"+"+STR$~(lastbyte-firstbyte)+" "+STR$~(start)+" "+STR$~(firstbyte))
 2660*OPT1,0
 2670END
 2680DEF FNfill(size)
 2690FOR count = 1 TO size
 2700?O%=0
 2710O%=O%+1
 2720P%=P%+1
 2730NEXT
 2740=pass

�: SECTOR5
� mcode &500
zeropage=&70
(oswrch=&FFEE
2osword=&FFF1
<osbyte=&FFF4
Fosnewl=&FFE7
Poswrch=&FFEE
Zosrdch=&FFE0
dosasci=&FFE3
n�pass=4 � 6 � 2
xO%=mcode
�
P%=�+&100
�
[OPT pass
�.firstbyte
�$EQUW &FF0D \ � the BASIC program
�
.start
�LDA #&0F
�JSR osasci \ scroll mode
�LDX #title � 256
�LDY #title � 256
�JSR print \ print title
�.getdata
�LDX #drivenum � 256
�LDY #drivenum � 256
JSR print \ which drive?
.whichdrive
JSR osrdch
"BCS escape
,SEC
6SBC #�("0")
@BMI whichdrive \ drive 0-3
JCMP #&04
TBCS whichdrive \ drive 0-3
^&STA block \ format parameter block
h,STA catblock \ catalogue parameter block
rADC #�("0")
|#JSR osasci \ print 0, 1, 2 or 3
�LDX #tracknum � 256
�LDY #tracknum � 256
� JSR print \ 40 or 80 tracks?
�.whichtrack
�JSR osrdch
�BCS escape
�LDX #&27 \ 40 tracks
�CMP #�("4")
�BEQ continue
�CMP #�("8")
�BNE whichtrack
�LDX #&4F \ 80 tracks
�
.continue
'STX finish \ store number of tracks
!JSR osasci \ print "8" or "4"
LDA #�("0")
&/JSR osasci \ print "0" to make "40" or "80"
0LDX #ready � 256
:LDY #ready � 256
D JSR print \ ready to format?
NJSR osrdch
XBCS escape
bPHA \ temp store for answer
lJSR osasci \ print answer
vJSR osnewl
�PLA \ pull answer
�� #&DF \ upper case
�CMP #�("Y")
�BNE getdata
�JSR osnewl
�
LDA #0
�
STA track
�LDA #&01 \ data size
�LDX #&10 \ gap 3
� LDY #&2A \ number of sectors
�
JSR setup
�LDA #&7F
�LDX #block � 256
LDY #block � 256
+JSR osword \ format track 0 ten sectors
!LDA result \ load result byte
 +BEQ trackzero \ format OK if result = 0
*
.error
4BRK
>BRK
HEQUS "Format error"
RBRK
\.escape
fLDA #&7E
p#JSR osbyte \ acknowledge Escape
zBRK
�BRK
�EQUS "Escape"
�BRK
�.trackzero
�LDA #&7F
�LDX #catblock � 256
�LDY #catblock � 256
�&JSR osword \ store empty catalogue
�%LDA catresult \ check result byte
�BNE error \ quit if error
�"JSR printbyte \ print track 00
�	.loop
�LDA &FF \ poll escape flag
,BMI escape \ bit 7 set if Escape pressed
&INC track \ increment track number
LDA #&02 \ data size
$LDX #&4A \ gap 3
. LDY #&45 \ number of sectors
8
JSR setup
BLDA #&7F
LLDX #block � 256
VLDY #block � 256
`,JSR osword \ format track with 5 sectors
j!LDA result \ load result byte
tBNE error \ quit if error
~!LDA track \ load track number
�PHA
�&JSR printbyte \ print track number
�PLA
�(CMP finish \ is that the last track?
�.BCC loop \ branch if more tracks to format
�LDX #another � 256
�LDY #another � 256
�JSR print \ another?
�JSR osrdch
�BCS escape
�PHA \ temp store for answer
�JSR osasci \ print answer
JSR osnewl

PLA \ pull answer
� #&DF \ upper case
CMP #�("Y")
(BNE return
2JMP getdata
<
.setup
FSTX gap3
PSTY numsectors
ZLDX #39
d
LDY track
nSTY physical
x.setloop
�STA table,X
�DEX
�DEX
�DEX
�PHA
�TYA
�STA table,X
�PLA
�DEX
�BPL setloop
�.return
�RTS
�
.print
STX zeropage
STY zeropage+1

LDY #0
".printloop
,LDA (zeropage),Y
6BEQ endprint
@JSR osasci
JINY
TBNE printloop
^
.endprint
hRTS
r.printbyte
|PHA
�	LSR A
�	LSR A
�	LSR A
�	LSR A
� JSR nybble \ print MS nybble
�PLA
� JSR nybble \ print LS nybble
�LDA #�(" ")
�JSR oswrch \ print space
�JMP oswrch \ print space
�.nybble
�
� #&0F
�SED
CLC
ADC #&90
ADC #&40
&CLD
0(JMP oswrch \ print nybble and return
:
.block
DEQUB &00 \ drive number 0-3
NEQUD table \ sector table
XEQUB &05 \ 5 parameters
bEQUB &63 \ format track
l
.physical
v&EQUB &00 \ physical track number 0
�	.gap3
�EQUB &15 \ gap 3
�.numsectors
�&EQUB &2A \ 10 sectors of 256 bytes
�EQUB &00 \ gap 5
�EQUB &10 \ gap 1
�.result
�EQUB &00 \ result byte
�
.table
�EQUD &00000000
�EQUD &00010000
�EQUD &00020000
�EQUD &00030000
EQUD &00040000
EQUD &00050000
EQUD &00060000
 EQUD &00070000
*EQUD &00080000
4EQUD &00090000
>.catalogue
H%EQUB &15 \ disc title (disable �)
ROPT �fill(7) \ 7 zero bytes
\"EQUS "!BOOT  $" \ next 8 bytes
f(OPT �fill(240) \ end of first sector
p)OPT �fill(5) \ start of second sector
z"EQUB &08 \ number of files * 8
�(EQUW &0A20 \ 10 sectors and *OPT 4,2
�$EQUD &00 \ load and exec = &0000
�$EQUW &0800 \ length = &800 bytes
�)EQUB &00 \ MS 2 bits of sector number
�#EQUB &02 \ starting at sector 2
�OPT �fill(240)
�
.catblock
�EQUB &00 \ drive number
�&EQUD catalogue \ address of buffer
�#EQUB &03 \ number of parameters
�%EQUB &4B \ save data multi sector
�EQUB &00 \ logical track
�#EQUB &00 \ start logical sector
	%EQUB &22 \ 2 sectors of 256 bytes
	.catresult
	EQUB &00 \ result byte
	$
.title
	.EQUB &0D
	8EQUS "5 Sector DFS Format"
	BEQUB &0D
	LBRK
	V
.drivenum
	`EQUB &0D
	jEQUS "Drive number? (0-3) "
	tBRK
	~
.tracknum
	�EQUB &0D
	�"EQUS "40 or 80 tracks? (4/8) "
	�BRK
	�
.ready
	�EQUB &0D
	�"EQUS "Ready to format? (Y/N) "
	�BRK
	�.another
	�EQUB &0D
	�EQUS "Another? (Y/N) "
	�BRK
	�
.track
$EQUB &00 \ physical track number

.finish
 EQUB &00 \ last track number

.lastbyte
(]
2�
<!�'"Save filename = "filename$
F� filename$ = "" � �
P*OPT1,2
Za�("SAVE "+filename$+" "+�~(mcode)+"+"+�~(lastbyte-firstbyte)+" "+�~(start)+" "+�~(firstbyte))
d*OPT1,0
n�
x� �fill(size)
�� count = 1 � size
�	?O%=0
�O%=O%+1
�P%=P%+1
��
�	=pass
�
00000000  0d 00 0a 0e f4 3a 20 53  45 43 54 4f 52 35 0d 00  |.....: SECTOR5..|
00000010  14 10 de 20 6d 63 6f 64  65 20 26 35 30 30 0d 00  |... mcode &500..|
00000020  1e 10 7a 65 72 6f 70 61  67 65 3d 26 37 30 0d 00  |..zeropage=&70..|
00000030  28 10 6f 73 77 72 63 68  3d 26 46 46 45 45 0d 00  |(.oswrch=&FFEE..|
00000040  32 10 6f 73 77 6f 72 64  3d 26 46 46 46 31 0d 00  |2.osword=&FFF1..|
00000050  3c 10 6f 73 62 79 74 65  3d 26 46 46 46 34 0d 00  |<.osbyte=&FFF4..|
00000060  46 10 6f 73 6e 65 77 6c  3d 26 46 46 45 37 0d 00  |F.osnewl=&FFE7..|
00000070  50 10 6f 73 77 72 63 68  3d 26 46 46 45 45 0d 00  |P.oswrch=&FFEE..|
00000080  5a 10 6f 73 72 64 63 68  3d 26 46 46 45 30 0d 00  |Z.osrdch=&FFE0..|
00000090  64 10 6f 73 61 73 63 69  3d 26 46 46 45 33 0d 00  |d.osasci=&FFE3..|
000000a0  6e 13 e3 70 61 73 73 3d  34 20 b8 20 36 20 88 20  |n..pass=4 . 6 . |
000000b0  32 0d 00 78 0c 4f 25 3d  6d 63 6f 64 65 0d 00 82  |2..x.O%=mcode...|
000000c0  0d 50 25 3d 90 2b 26 31  30 30 0d 00 8c 0d 5b 4f  |.P%=.+&100....[O|
000000d0  50 54 20 70 61 73 73 0d  00 96 0e 2e 66 69 72 73  |PT pass.....firs|
000000e0  74 62 79 74 65 0d 00 a0  24 45 51 55 57 20 26 46  |tbyte...$EQUW &F|
000000f0  46 30 44 20 5c 20 ca 20  74 68 65 20 42 41 53 49  |F0D \ . the BASI|
00000100  43 20 70 72 6f 67 72 61  6d 0d 00 aa 0a 2e 73 74  |C program.....st|
00000110  61 72 74 0d 00 b4 0c 4c  44 41 20 23 26 30 46 0d  |art....LDA #&0F.|
00000120  00 be 1c 4a 53 52 20 6f  73 61 73 63 69 20 5c 20  |...JSR osasci \ |
00000130  73 63 72 6f 6c 6c 20 6d  6f 64 65 0d 00 c8 14 4c  |scroll mode....L|
00000140  44 58 20 23 74 69 74 6c  65 20 83 20 32 35 36 0d  |DX #title . 256.|
00000150  00 d2 14 4c 44 59 20 23  74 69 74 6c 65 20 81 20  |...LDY #title . |
00000160  32 35 36 0d 00 dc 1b 4a  53 52 20 70 72 69 6e 74  |256....JSR print|
00000170  20 5c 20 70 72 69 6e 74  20 74 69 74 6c 65 0d 00  | \ print title..|
00000180  e6 0c 2e 67 65 74 64 61  74 61 0d 00 f0 17 4c 44  |...getdata....LD|
00000190  58 20 23 64 72 69 76 65  6e 75 6d 20 83 20 32 35  |X #drivenum . 25|
000001a0  36 0d 00 fa 17 4c 44 59  20 23 64 72 69 76 65 6e  |6....LDY #driven|
000001b0  75 6d 20 81 20 32 35 36  0d 01 04 1c 4a 53 52 20  |um . 256....JSR |
000001c0  70 72 69 6e 74 20 5c 20  77 68 69 63 68 20 64 72  |print \ which dr|
000001d0  69 76 65 3f 0d 01 0e 0f  2e 77 68 69 63 68 64 72  |ive?.....whichdr|
000001e0  69 76 65 0d 01 18 0e 4a  53 52 20 6f 73 72 64 63  |ive....JSR osrdc|
000001f0  68 0d 01 22 0e 42 43 53  20 65 73 63 61 70 65 0d  |h..".BCS escape.|
00000200  01 2c 07 53 45 43 0d 01  36 0f 53 42 43 20 23 97  |.,.SEC..6.SBC #.|
00000210  28 22 30 22 29 0d 01 40  1e 42 4d 49 20 77 68 69  |("0")..@.BMI whi|
00000220  63 68 64 72 69 76 65 20  5c 20 64 72 69 76 65 20  |chdrive \ drive |
00000230  30 2d 33 0d 01 4a 0c 43  4d 50 20 23 26 30 34 0d  |0-3..J.CMP #&04.|
00000240  01 54 1e 42 43 53 20 77  68 69 63 68 64 72 69 76  |.T.BCS whichdriv|
00000250  65 20 5c 20 64 72 69 76  65 20 30 2d 33 0d 01 5e  |e \ drive 0-3..^|
00000260  26 53 54 41 20 62 6c 6f  63 6b 20 5c 20 66 6f 72  |&STA block \ for|
00000270  6d 61 74 20 70 61 72 61  6d 65 74 65 72 20 62 6c  |mat parameter bl|
00000280  6f 63 6b 0d 01 68 2c 53  54 41 20 63 61 74 62 6c  |ock..h,STA catbl|
00000290  6f 63 6b 20 5c 20 63 61  74 61 6c 6f 67 75 65 20  |ock \ catalogue |
000002a0  70 61 72 61 6d 65 74 65  72 20 62 6c 6f 63 6b 0d  |parameter block.|
000002b0  01 72 0f 41 44 43 20 23  97 28 22 30 22 29 0d 01  |.r.ADC #.("0")..|
000002c0  7c 23 4a 53 52 20 6f 73  61 73 63 69 20 5c 20 70  ||#JSR osasci \ p|
000002d0  72 69 6e 74 20 30 2c 20  31 2c 20 32 20 6f 72 20  |rint 0, 1, 2 or |
000002e0  33 0d 01 86 17 4c 44 58  20 23 74 72 61 63 6b 6e  |3....LDX #trackn|
000002f0  75 6d 20 83 20 32 35 36  0d 01 90 17 4c 44 59 20  |um . 256....LDY |
00000300  23 74 72 61 63 6b 6e 75  6d 20 81 20 32 35 36 0d  |#tracknum . 256.|
00000310  01 9a 20 4a 53 52 20 70  72 69 6e 74 20 5c 20 34  |.. JSR print \ 4|
00000320  30 20 6f 72 20 38 30 20  74 72 61 63 6b 73 3f 0d  |0 or 80 tracks?.|
00000330  01 a4 0f 2e 77 68 69 63  68 74 72 61 63 6b 0d 01  |....whichtrack..|
00000340  ae 0e 4a 53 52 20 6f 73  72 64 63 68 0d 01 b8 0e  |..JSR osrdch....|
00000350  42 43 53 20 65 73 63 61  70 65 0d 01 c2 18 4c 44  |BCS escape....LD|
00000360  58 20 23 26 32 37 20 5c  20 34 30 20 74 72 61 63  |X #&27 \ 40 trac|
00000370  6b 73 0d 01 cc 0f 43 4d  50 20 23 97 28 22 34 22  |ks....CMP #.("4"|
00000380  29 0d 01 d6 10 42 45 51  20 63 6f 6e 74 69 6e 75  |)....BEQ continu|
00000390  65 0d 01 e0 0f 43 4d 50  20 23 97 28 22 38 22 29  |e....CMP #.("8")|
000003a0  0d 01 ea 12 42 4e 45 20  77 68 69 63 68 74 72 61  |....BNE whichtra|
000003b0  63 6b 0d 01 f4 18 4c 44  58 20 23 26 34 46 20 5c  |ck....LDX #&4F \|
000003c0  20 38 30 20 74 72 61 63  6b 73 0d 01 fe 0d 2e 63  | 80 tracks.....c|
000003d0  6f 6e 74 69 6e 75 65 0d  02 08 27 53 54 58 20 66  |ontinue...'STX f|
000003e0  69 6e 69 73 68 20 5c 20  73 74 6f 72 65 20 6e 75  |inish \ store nu|
000003f0  6d 62 65 72 20 6f 66 20  74 72 61 63 6b 73 0d 02  |mber of tracks..|
00000400  12 21 4a 53 52 20 6f 73  61 73 63 69 20 5c 20 70  |.!JSR osasci \ p|
00000410  72 69 6e 74 20 22 38 22  20 6f 72 20 22 34 22 0d  |rint "8" or "4".|
00000420  02 1c 0f 4c 44 41 20 23  97 28 22 30 22 29 0d 02  |...LDA #.("0")..|
00000430  26 2f 4a 53 52 20 6f 73  61 73 63 69 20 5c 20 70  |&/JSR osasci \ p|
00000440  72 69 6e 74 20 22 30 22  20 74 6f 20 6d 61 6b 65  |rint "0" to make|
00000450  20 22 34 30 22 20 6f 72  20 22 38 30 22 0d 02 30  | "40" or "80"..0|
00000460  14 4c 44 58 20 23 72 65  61 64 79 20 83 20 32 35  |.LDX #ready . 25|
00000470  36 0d 02 3a 14 4c 44 59  20 23 72 65 61 64 79 20  |6..:.LDY #ready |
00000480  81 20 32 35 36 0d 02 44  20 4a 53 52 20 70 72 69  |. 256..D JSR pri|
00000490  6e 74 20 5c 20 72 65 61  64 79 20 74 6f 20 66 6f  |nt \ ready to fo|
000004a0  72 6d 61 74 3f 0d 02 4e  0e 4a 53 52 20 6f 73 72  |rmat?..N.JSR osr|
000004b0  64 63 68 0d 02 58 0e 42  43 53 20 65 73 63 61 70  |dch..X.BCS escap|
000004c0  65 0d 02 62 1f 50 48 41  20 5c 20 74 65 6d 70 20  |e..b.PHA \ temp |
000004d0  73 74 6f 72 65 20 66 6f  72 20 61 6e 73 77 65 72  |store for answer|
000004e0  0d 02 6c 1d 4a 53 52 20  6f 73 61 73 63 69 20 5c  |..l.JSR osasci \|
000004f0  20 70 72 69 6e 74 20 61  6e 73 77 65 72 0d 02 76  | print answer..v|
00000500  0e 4a 53 52 20 6f 73 6e  65 77 6c 0d 02 80 15 50  |.JSR osnewl....P|
00000510  4c 41 20 5c 20 70 75 6c  6c 20 61 6e 73 77 65 72  |LA \ pull answer|
00000520  0d 02 8a 17 80 20 23 26  44 46 20 5c 20 75 70 70  |..... #&DF \ upp|
00000530  65 72 20 63 61 73 65 0d  02 94 0f 43 4d 50 20 23  |er case....CMP #|
00000540  97 28 22 59 22 29 0d 02  9e 0f 42 4e 45 20 67 65  |.("Y")....BNE ge|
00000550  74 64 61 74 61 0d 02 a8  0e 4a 53 52 20 6f 73 6e  |tdata....JSR osn|
00000560  65 77 6c 0d 02 b2 0a 4c  44 41 20 23 30 0d 02 bc  |ewl....LDA #0...|
00000570  0d 53 54 41 20 74 72 61  63 6b 0d 02 c6 18 4c 44  |.STA track....LD|
00000580  41 20 23 26 30 31 20 5c  20 64 61 74 61 20 73 69  |A #&01 \ data si|
00000590  7a 65 0d 02 d0 14 4c 44  58 20 23 26 31 30 20 5c  |ze....LDX #&10 \|
000005a0  20 67 61 70 20 33 0d 02  da 20 4c 44 59 20 23 26  | gap 3... LDY #&|
000005b0  32 41 20 5c 20 6e 75 6d  62 65 72 20 6f 66 20 73  |2A \ number of s|
000005c0  65 63 74 6f 72 73 0d 02  e4 0d 4a 53 52 20 73 65  |ectors....JSR se|
000005d0  74 75 70 0d 02 ee 0c 4c  44 41 20 23 26 37 46 0d  |tup....LDA #&7F.|
000005e0  02 f8 14 4c 44 58 20 23  62 6c 6f 63 6b 20 83 20  |...LDX #block . |
000005f0  32 35 36 0d 03 02 14 4c  44 59 20 23 62 6c 6f 63  |256....LDY #bloc|
00000600  6b 20 81 20 32 35 36 0d  03 0c 2b 4a 53 52 20 6f  |k . 256...+JSR o|
00000610  73 77 6f 72 64 20 5c 20  66 6f 72 6d 61 74 20 74  |sword \ format t|
00000620  72 61 63 6b 20 30 20 74  65 6e 20 73 65 63 74 6f  |rack 0 ten secto|
00000630  72 73 0d 03 16 21 4c 44  41 20 72 65 73 75 6c 74  |rs...!LDA result|
00000640  20 5c 20 6c 6f 61 64 20  72 65 73 75 6c 74 20 62  | \ load result b|
00000650  79 74 65 0d 03 20 2b 42  45 51 20 74 72 61 63 6b  |yte.. +BEQ track|
00000660  7a 65 72 6f 20 5c 20 66  6f 72 6d 61 74 20 4f 4b  |zero \ format OK|
00000670  20 69 66 20 72 65 73 75  6c 74 20 3d 20 30 0d 03  | if result = 0..|
00000680  2a 0a 2e 65 72 72 6f 72  0d 03 34 07 42 52 4b 0d  |*..error..4.BRK.|
00000690  03 3e 07 42 52 4b 0d 03  48 17 45 51 55 53 20 22  |.>.BRK..H.EQUS "|
000006a0  46 6f 72 6d 61 74 20 65  72 72 6f 72 22 0d 03 52  |Format error"..R|
000006b0  07 42 52 4b 0d 03 5c 0b  2e 65 73 63 61 70 65 0d  |.BRK..\..escape.|
000006c0  03 66 0c 4c 44 41 20 23  26 37 45 0d 03 70 23 4a  |.f.LDA #&7E..p#J|
000006d0  53 52 20 6f 73 62 79 74  65 20 5c 20 61 63 6b 6e  |SR osbyte \ ackn|
000006e0  6f 77 6c 65 64 67 65 20  45 73 63 61 70 65 0d 03  |owledge Escape..|
000006f0  7a 07 42 52 4b 0d 03 84  07 42 52 4b 0d 03 8e 11  |z.BRK....BRK....|
00000700  45 51 55 53 20 22 45 73  63 61 70 65 22 0d 03 98  |EQUS "Escape"...|
00000710  07 42 52 4b 0d 03 a2 0e  2e 74 72 61 63 6b 7a 65  |.BRK.....trackze|
00000720  72 6f 0d 03 ac 0c 4c 44  41 20 23 26 37 46 0d 03  |ro....LDA #&7F..|
00000730  b6 17 4c 44 58 20 23 63  61 74 62 6c 6f 63 6b 20  |..LDX #catblock |
00000740  83 20 32 35 36 0d 03 c0  17 4c 44 59 20 23 63 61  |. 256....LDY #ca|
00000750  74 62 6c 6f 63 6b 20 81  20 32 35 36 0d 03 ca 26  |tblock . 256...&|
00000760  4a 53 52 20 6f 73 77 6f  72 64 20 5c 20 73 74 6f  |JSR osword \ sto|
00000770  72 65 20 65 6d 70 74 79  20 63 61 74 61 6c 6f 67  |re empty catalog|
00000780  75 65 0d 03 d4 25 4c 44  41 20 63 61 74 72 65 73  |ue...%LDA catres|
00000790  75 6c 74 20 5c 20 63 68  65 63 6b 20 72 65 73 75  |ult \ check resu|
000007a0  6c 74 20 62 79 74 65 0d  03 de 1d 42 4e 45 20 65  |lt byte....BNE e|
000007b0  72 72 6f 72 20 5c 20 71  75 69 74 20 69 66 20 65  |rror \ quit if e|
000007c0  72 72 6f 72 0d 03 e8 22  4a 53 52 20 70 72 69 6e  |rror..."JSR prin|
000007d0  74 62 79 74 65 20 5c 20  70 72 69 6e 74 20 74 72  |tbyte \ print tr|
000007e0  61 63 6b 20 30 30 0d 03  f2 09 2e 6c 6f 6f 70 0d  |ack 00.....loop.|
000007f0  03 fc 1e 4c 44 41 20 26  46 46 20 5c 20 70 6f 6c  |...LDA &FF \ pol|
00000800  6c 20 65 73 63 61 70 65  20 66 6c 61 67 0d 04 06  |l escape flag...|
00000810  2c 42 4d 49 20 65 73 63  61 70 65 20 5c 20 62 69  |,BMI escape \ bi|
00000820  74 20 37 20 73 65 74 20  69 66 20 45 73 63 61 70  |t 7 set if Escap|
00000830  65 20 70 72 65 73 73 65  64 0d 04 10 26 49 4e 43  |e pressed...&INC|
00000840  20 74 72 61 63 6b 20 5c  20 69 6e 63 72 65 6d 65  | track \ increme|
00000850  6e 74 20 74 72 61 63 6b  20 6e 75 6d 62 65 72 0d  |nt track number.|
00000860  04 1a 18 4c 44 41 20 23  26 30 32 20 5c 20 64 61  |...LDA #&02 \ da|
00000870  74 61 20 73 69 7a 65 0d  04 24 14 4c 44 58 20 23  |ta size..$.LDX #|
00000880  26 34 41 20 5c 20 67 61  70 20 33 0d 04 2e 20 4c  |&4A \ gap 3... L|
00000890  44 59 20 23 26 34 35 20  5c 20 6e 75 6d 62 65 72  |DY #&45 \ number|
000008a0  20 6f 66 20 73 65 63 74  6f 72 73 0d 04 38 0d 4a  | of sectors..8.J|
000008b0  53 52 20 73 65 74 75 70  0d 04 42 0c 4c 44 41 20  |SR setup..B.LDA |
000008c0  23 26 37 46 0d 04 4c 14  4c 44 58 20 23 62 6c 6f  |#&7F..L.LDX #blo|
000008d0  63 6b 20 83 20 32 35 36  0d 04 56 14 4c 44 59 20  |ck . 256..V.LDY |
000008e0  23 62 6c 6f 63 6b 20 81  20 32 35 36 0d 04 60 2c  |#block . 256..`,|
000008f0  4a 53 52 20 6f 73 77 6f  72 64 20 5c 20 66 6f 72  |JSR osword \ for|
00000900  6d 61 74 20 74 72 61 63  6b 20 77 69 74 68 20 35  |mat track with 5|
00000910  20 73 65 63 74 6f 72 73  0d 04 6a 21 4c 44 41 20  | sectors..j!LDA |
00000920  72 65 73 75 6c 74 20 5c  20 6c 6f 61 64 20 72 65  |result \ load re|
00000930  73 75 6c 74 20 62 79 74  65 0d 04 74 1d 42 4e 45  |sult byte..t.BNE|
00000940  20 65 72 72 6f 72 20 5c  20 71 75 69 74 20 69 66  | error \ quit if|
00000950  20 65 72 72 6f 72 0d 04  7e 21 4c 44 41 20 74 72  | error..~!LDA tr|
00000960  61 63 6b 20 5c 20 6c 6f  61 64 20 74 72 61 63 6b  |ack \ load track|
00000970  20 6e 75 6d 62 65 72 0d  04 88 07 50 48 41 0d 04  | number....PHA..|
00000980  92 26 4a 53 52 20 70 72  69 6e 74 62 79 74 65 20  |.&JSR printbyte |
00000990  5c 20 70 72 69 6e 74 20  74 72 61 63 6b 20 6e 75  |\ print track nu|
000009a0  6d 62 65 72 0d 04 9c 07  50 4c 41 0d 04 a6 28 43  |mber....PLA...(C|
000009b0  4d 50 20 66 69 6e 69 73  68 20 5c 20 69 73 20 74  |MP finish \ is t|
000009c0  68 61 74 20 74 68 65 20  6c 61 73 74 20 74 72 61  |hat the last tra|
000009d0  63 6b 3f 0d 04 b0 2e 42  43 43 20 6c 6f 6f 70 20  |ck?....BCC loop |
000009e0  5c 20 62 72 61 6e 63 68  20 69 66 20 6d 6f 72 65  |\ branch if more|
000009f0  20 74 72 61 63 6b 73 20  74 6f 20 66 6f 72 6d 61  | tracks to forma|
00000a00  74 0d 04 ba 16 4c 44 58  20 23 61 6e 6f 74 68 65  |t....LDX #anothe|
00000a10  72 20 83 20 32 35 36 0d  04 c4 16 4c 44 59 20 23  |r . 256....LDY #|
00000a20  61 6e 6f 74 68 65 72 20  81 20 32 35 36 0d 04 ce  |another . 256...|
00000a30  18 4a 53 52 20 70 72 69  6e 74 20 5c 20 61 6e 6f  |.JSR print \ ano|
00000a40  74 68 65 72 3f 0d 04 d8  0e 4a 53 52 20 6f 73 72  |ther?....JSR osr|
00000a50  64 63 68 0d 04 e2 0e 42  43 53 20 65 73 63 61 70  |dch....BCS escap|
00000a60  65 0d 04 ec 1f 50 48 41  20 5c 20 74 65 6d 70 20  |e....PHA \ temp |
00000a70  73 74 6f 72 65 20 66 6f  72 20 61 6e 73 77 65 72  |store for answer|
00000a80  0d 04 f6 1d 4a 53 52 20  6f 73 61 73 63 69 20 5c  |....JSR osasci \|
00000a90  20 70 72 69 6e 74 20 61  6e 73 77 65 72 0d 05 00  | print answer...|
00000aa0  0e 4a 53 52 20 6f 73 6e  65 77 6c 0d 05 0a 15 50  |.JSR osnewl....P|
00000ab0  4c 41 20 5c 20 70 75 6c  6c 20 61 6e 73 77 65 72  |LA \ pull answer|
00000ac0  0d 05 14 17 80 20 23 26  44 46 20 5c 20 75 70 70  |..... #&DF \ upp|
00000ad0  65 72 20 63 61 73 65 0d  05 1e 0f 43 4d 50 20 23  |er case....CMP #|
00000ae0  97 28 22 59 22 29 0d 05  28 0e 42 4e 45 20 72 65  |.("Y")..(.BNE re|
00000af0  74 75 72 6e 0d 05 32 0f  4a 4d 50 20 67 65 74 64  |turn..2.JMP getd|
00000b00  61 74 61 0d 05 3c 0a 2e  73 65 74 75 70 0d 05 46  |ata..<..setup..F|
00000b10  0c 53 54 58 20 67 61 70  33 0d 05 50 12 53 54 59  |.STX gap3..P.STY|
00000b20  20 6e 75 6d 73 65 63 74  6f 72 73 0d 05 5a 0b 4c  | numsectors..Z.L|
00000b30  44 58 20 23 33 39 0d 05  64 0d 4c 44 59 20 74 72  |DX #39..d.LDY tr|
00000b40  61 63 6b 0d 05 6e 10 53  54 59 20 70 68 79 73 69  |ack..n.STY physi|
00000b50  63 61 6c 0d 05 78 0c 2e  73 65 74 6c 6f 6f 70 0d  |cal..x..setloop.|
00000b60  05 82 0f 53 54 41 20 74  61 62 6c 65 2c 58 0d 05  |...STA table,X..|
00000b70  8c 07 44 45 58 0d 05 96  07 44 45 58 0d 05 a0 07  |..DEX....DEX....|
00000b80  44 45 58 0d 05 aa 07 50  48 41 0d 05 b4 07 54 59  |DEX....PHA....TY|
00000b90  41 0d 05 be 0f 53 54 41  20 74 61 62 6c 65 2c 58  |A....STA table,X|
00000ba0  0d 05 c8 07 50 4c 41 0d  05 d2 07 44 45 58 0d 05  |....PLA....DEX..|
00000bb0  dc 0f 42 50 4c 20 73 65  74 6c 6f 6f 70 0d 05 e6  |..BPL setloop...|
00000bc0  0b 2e 72 65 74 75 72 6e  0d 05 f0 07 52 54 53 0d  |..return....RTS.|
00000bd0  05 fa 0a 2e 70 72 69 6e  74 0d 06 04 10 53 54 58  |....print....STX|
00000be0  20 7a 65 72 6f 70 61 67  65 0d 06 0e 12 53 54 59  | zeropage....STY|
00000bf0  20 7a 65 72 6f 70 61 67  65 2b 31 0d 06 18 0a 4c  | zeropage+1....L|
00000c00  44 59 20 23 30 0d 06 22  0e 2e 70 72 69 6e 74 6c  |DY #0.."..printl|
00000c10  6f 6f 70 0d 06 2c 14 4c  44 41 20 28 7a 65 72 6f  |oop..,.LDA (zero|
00000c20  70 61 67 65 29 2c 59 0d  06 36 10 42 45 51 20 65  |page),Y..6.BEQ e|
00000c30  6e 64 70 72 69 6e 74 0d  06 40 0e 4a 53 52 20 6f  |ndprint..@.JSR o|
00000c40  73 61 73 63 69 0d 06 4a  07 49 4e 59 0d 06 54 11  |sasci..J.INY..T.|
00000c50  42 4e 45 20 70 72 69 6e  74 6c 6f 6f 70 0d 06 5e  |BNE printloop..^|
00000c60  0d 2e 65 6e 64 70 72 69  6e 74 0d 06 68 07 52 54  |..endprint..h.RT|
00000c70  53 0d 06 72 0e 2e 70 72  69 6e 74 62 79 74 65 0d  |S..r..printbyte.|
00000c80  06 7c 07 50 48 41 0d 06  86 09 4c 53 52 20 41 0d  |.|.PHA....LSR A.|
00000c90  06 90 09 4c 53 52 20 41  0d 06 9a 09 4c 53 52 20  |...LSR A....LSR |
00000ca0  41 0d 06 a4 09 4c 53 52  20 41 0d 06 ae 20 4a 53  |A....LSR A... JS|
00000cb0  52 20 6e 79 62 62 6c 65  20 5c 20 70 72 69 6e 74  |R nybble \ print|
00000cc0  20 4d 53 20 6e 79 62 62  6c 65 0d 06 b8 07 50 4c  | MS nybble....PL|
00000cd0  41 0d 06 c2 20 4a 53 52  20 6e 79 62 62 6c 65 20  |A... JSR nybble |
00000ce0  5c 20 70 72 69 6e 74 20  4c 53 20 6e 79 62 62 6c  |\ print LS nybbl|
00000cf0  65 0d 06 cc 0f 4c 44 41  20 23 97 28 22 20 22 29  |e....LDA #.(" ")|
00000d00  0d 06 d6 1c 4a 53 52 20  6f 73 77 72 63 68 20 5c  |....JSR oswrch \|
00000d10  20 70 72 69 6e 74 20 73  70 61 63 65 0d 06 e0 1c  | print space....|
00000d20  4a 4d 50 20 6f 73 77 72  63 68 20 5c 20 70 72 69  |JMP oswrch \ pri|
00000d30  6e 74 20 73 70 61 63 65  0d 06 ea 0b 2e 6e 79 62  |nt space.....nyb|
00000d40  62 6c 65 0d 06 f4 0a 80  20 23 26 30 46 0d 06 fe  |ble..... #&0F...|
00000d50  07 53 45 44 0d 07 08 07  43 4c 43 0d 07 12 0c 41  |.SED....CLC....A|
00000d60  44 43 20 23 26 39 30 0d  07 1c 0c 41 44 43 20 23  |DC #&90....ADC #|
00000d70  26 34 30 0d 07 26 07 43  4c 44 0d 07 30 28 4a 4d  |&40..&.CLD..0(JM|
00000d80  50 20 6f 73 77 72 63 68  20 5c 20 70 72 69 6e 74  |P oswrch \ print|
00000d90  20 6e 79 62 62 6c 65 20  61 6e 64 20 72 65 74 75  | nybble and retu|
00000da0  72 6e 0d 07 3a 0a 2e 62  6c 6f 63 6b 0d 07 44 1f  |rn..:..block..D.|
00000db0  45 51 55 42 20 26 30 30  20 5c 20 64 72 69 76 65  |EQUB &00 \ drive|
00000dc0  20 6e 75 6d 62 65 72 20  30 2d 33 0d 07 4e 1d 45  | number 0-3..N.E|
00000dd0  51 55 44 20 74 61 62 6c  65 20 5c 20 73 65 63 74  |QUD table \ sect|
00000de0  6f 72 20 74 61 62 6c 65  0d 07 58 1b 45 51 55 42  |or table..X.EQUB|
00000df0  20 26 30 35 20 5c 20 35  20 70 61 72 61 6d 65 74  | &05 \ 5 paramet|
00000e00  65 72 73 0d 07 62 1b 45  51 55 42 20 26 36 33 20  |ers..b.EQUB &63 |
00000e10  5c 20 66 6f 72 6d 61 74  20 74 72 61 63 6b 0d 07  |\ format track..|
00000e20  6c 0d 2e 70 68 79 73 69  63 61 6c 0d 07 76 26 45  |l..physical..v&E|
00000e30  51 55 42 20 26 30 30 20  5c 20 70 68 79 73 69 63  |QUB &00 \ physic|
00000e40  61 6c 20 74 72 61 63 6b  20 6e 75 6d 62 65 72 20  |al track number |
00000e50  30 0d 07 80 09 2e 67 61  70 33 0d 07 8a 14 45 51  |0.....gap3....EQ|
00000e60  55 42 20 26 31 35 20 5c  20 67 61 70 20 33 0d 07  |UB &15 \ gap 3..|
00000e70  94 0f 2e 6e 75 6d 73 65  63 74 6f 72 73 0d 07 9e  |...numsectors...|
00000e80  26 45 51 55 42 20 26 32  41 20 5c 20 31 30 20 73  |&EQUB &2A \ 10 s|
00000e90  65 63 74 6f 72 73 20 6f  66 20 32 35 36 20 62 79  |ectors of 256 by|
00000ea0  74 65 73 0d 07 a8 14 45  51 55 42 20 26 30 30 20  |tes....EQUB &00 |
00000eb0  5c 20 67 61 70 20 35 0d  07 b2 14 45 51 55 42 20  |\ gap 5....EQUB |
00000ec0  26 31 30 20 5c 20 67 61  70 20 31 0d 07 bc 0b 2e  |&10 \ gap 1.....|
00000ed0  72 65 73 75 6c 74 0d 07  c6 1a 45 51 55 42 20 26  |result....EQUB &|
00000ee0  30 30 20 5c 20 72 65 73  75 6c 74 20 62 79 74 65  |00 \ result byte|
00000ef0  0d 07 d0 0a 2e 74 61 62  6c 65 0d 07 da 12 45 51  |.....table....EQ|
00000f00  55 44 20 26 30 30 30 30  30 30 30 30 0d 07 e4 12  |UD &00000000....|
00000f10  45 51 55 44 20 26 30 30  30 31 30 30 30 30 0d 07  |EQUD &00010000..|
00000f20  ee 12 45 51 55 44 20 26  30 30 30 32 30 30 30 30  |..EQUD &00020000|
00000f30  0d 07 f8 12 45 51 55 44  20 26 30 30 30 33 30 30  |....EQUD &000300|
00000f40  30 30 0d 08 02 12 45 51  55 44 20 26 30 30 30 34  |00....EQUD &0004|
00000f50  30 30 30 30 0d 08 0c 12  45 51 55 44 20 26 30 30  |0000....EQUD &00|
00000f60  30 35 30 30 30 30 0d 08  16 12 45 51 55 44 20 26  |050000....EQUD &|
00000f70  30 30 30 36 30 30 30 30  0d 08 20 12 45 51 55 44  |00060000.. .EQUD|
00000f80  20 26 30 30 30 37 30 30  30 30 0d 08 2a 12 45 51  | &00070000..*.EQ|
00000f90  55 44 20 26 30 30 30 38  30 30 30 30 0d 08 34 12  |UD &00080000..4.|
00000fa0  45 51 55 44 20 26 30 30  30 39 30 30 30 30 0d 08  |EQUD &00090000..|
00000fb0  3e 0e 2e 63 61 74 61 6c  6f 67 75 65 0d 08 48 25  |>..catalogue..H%|
00000fc0  45 51 55 42 20 26 31 35  20 5c 20 64 69 73 63 20  |EQUB &15 \ disc |
00000fd0  74 69 74 6c 65 20 28 64  69 73 61 62 6c 65 20 ef  |title (disable .|
00000fe0  29 0d 08 52 1f 4f 50 54  20 a4 66 69 6c 6c 28 37  |)..R.OPT .fill(7|
00000ff0  29 20 5c 20 37 20 7a 65  72 6f 20 62 79 74 65 73  |) \ 7 zero bytes|
00001000  0d 08 5c 22 45 51 55 53  20 22 21 42 4f 4f 54 20  |..\"EQUS "!BOOT |
00001010  20 24 22 20 5c 20 6e 65  78 74 20 38 20 62 79 74  | $" \ next 8 byt|
00001020  65 73 0d 08 66 28 4f 50  54 20 a4 66 69 6c 6c 28  |es..f(OPT .fill(|
00001030  32 34 30 29 20 5c 20 65  6e 64 20 6f 66 20 66 69  |240) \ end of fi|
00001040  72 73 74 20 73 65 63 74  6f 72 0d 08 70 29 4f 50  |rst sector..p)OP|
00001050  54 20 a4 66 69 6c 6c 28  35 29 20 5c 20 73 74 61  |T .fill(5) \ sta|
00001060  72 74 20 6f 66 20 73 65  63 6f 6e 64 20 73 65 63  |rt of second sec|
00001070  74 6f 72 0d 08 7a 22 45  51 55 42 20 26 30 38 20  |tor..z"EQUB &08 |
00001080  5c 20 6e 75 6d 62 65 72  20 6f 66 20 66 69 6c 65  |\ number of file|
00001090  73 20 2a 20 38 0d 08 84  28 45 51 55 57 20 26 30  |s * 8...(EQUW &0|
000010a0  41 32 30 20 5c 20 31 30  20 73 65 63 74 6f 72 73  |A20 \ 10 sectors|
000010b0  20 61 6e 64 20 2a 4f 50  54 20 34 2c 32 0d 08 8e  | and *OPT 4,2...|
000010c0  24 45 51 55 44 20 26 30  30 20 5c 20 6c 6f 61 64  |$EQUD &00 \ load|
000010d0  20 61 6e 64 20 65 78 65  63 20 3d 20 26 30 30 30  | and exec = &000|
000010e0  30 0d 08 98 24 45 51 55  57 20 26 30 38 30 30 20  |0...$EQUW &0800 |
000010f0  5c 20 6c 65 6e 67 74 68  20 3d 20 26 38 30 30 20  |\ length = &800 |
00001100  62 79 74 65 73 0d 08 a2  29 45 51 55 42 20 26 30  |bytes...)EQUB &0|
00001110  30 20 5c 20 4d 53 20 32  20 62 69 74 73 20 6f 66  |0 \ MS 2 bits of|
00001120  20 73 65 63 74 6f 72 20  6e 75 6d 62 65 72 0d 08  | sector number..|
00001130  ac 23 45 51 55 42 20 26  30 32 20 5c 20 73 74 61  |.#EQUB &02 \ sta|
00001140  72 74 69 6e 67 20 61 74  20 73 65 63 74 6f 72 20  |rting at sector |
00001150  32 0d 08 b6 12 4f 50 54  20 a4 66 69 6c 6c 28 32  |2....OPT .fill(2|
00001160  34 30 29 0d 08 c0 0d 2e  63 61 74 62 6c 6f 63 6b  |40).....catblock|
00001170  0d 08 ca 1b 45 51 55 42  20 26 30 30 20 5c 20 64  |....EQUB &00 \ d|
00001180  72 69 76 65 20 6e 75 6d  62 65 72 0d 08 d4 26 45  |rive number...&E|
00001190  51 55 44 20 63 61 74 61  6c 6f 67 75 65 20 5c 20  |QUD catalogue \ |
000011a0  61 64 64 72 65 73 73 20  6f 66 20 62 75 66 66 65  |address of buffe|
000011b0  72 0d 08 de 23 45 51 55  42 20 26 30 33 20 5c 20  |r...#EQUB &03 \ |
000011c0  6e 75 6d 62 65 72 20 6f  66 20 70 61 72 61 6d 65  |number of parame|
000011d0  74 65 72 73 0d 08 e8 25  45 51 55 42 20 26 34 42  |ters...%EQUB &4B|
000011e0  20 5c 20 73 61 76 65 20  64 61 74 61 20 6d 75 6c  | \ save data mul|
000011f0  74 69 20 73 65 63 74 6f  72 0d 08 f2 1c 45 51 55  |ti sector....EQU|
00001200  42 20 26 30 30 20 5c 20  6c 6f 67 69 63 61 6c 20  |B &00 \ logical |
00001210  74 72 61 63 6b 0d 08 fc  23 45 51 55 42 20 26 30  |track...#EQUB &0|
00001220  30 20 5c 20 73 74 61 72  74 20 6c 6f 67 69 63 61  |0 \ start logica|
00001230  6c 20 73 65 63 74 6f 72  0d 09 06 25 45 51 55 42  |l sector...%EQUB|
00001240  20 26 32 32 20 5c 20 32  20 73 65 63 74 6f 72 73  | &22 \ 2 sectors|
00001250  20 6f 66 20 32 35 36 20  62 79 74 65 73 0d 09 10  | of 256 bytes...|
00001260  0e 2e 63 61 74 72 65 73  75 6c 74 0d 09 1a 1a 45  |..catresult....E|
00001270  51 55 42 20 26 30 30 20  5c 20 72 65 73 75 6c 74  |QUB &00 \ result|
00001280  20 62 79 74 65 0d 09 24  0a 2e 74 69 74 6c 65 0d  | byte..$..title.|
00001290  09 2e 0c 45 51 55 42 20  26 30 44 0d 09 38 1e 45  |...EQUB &0D..8.E|
000012a0  51 55 53 20 22 35 20 53  65 63 74 6f 72 20 44 46  |QUS "5 Sector DF|
000012b0  53 20 46 6f 72 6d 61 74  22 0d 09 42 0c 45 51 55  |S Format"..B.EQU|
000012c0  42 20 26 30 44 0d 09 4c  07 42 52 4b 0d 09 56 0d  |B &0D..L.BRK..V.|
000012d0  2e 64 72 69 76 65 6e 75  6d 0d 09 60 0c 45 51 55  |.drivenum..`.EQU|
000012e0  42 20 26 30 44 0d 09 6a  1f 45 51 55 53 20 22 44  |B &0D..j.EQUS "D|
000012f0  72 69 76 65 20 6e 75 6d  62 65 72 3f 20 28 30 2d  |rive number? (0-|
00001300  33 29 20 22 0d 09 74 07  42 52 4b 0d 09 7e 0d 2e  |3) "..t.BRK..~..|
00001310  74 72 61 63 6b 6e 75 6d  0d 09 88 0c 45 51 55 42  |tracknum....EQUB|
00001320  20 26 30 44 0d 09 92 22  45 51 55 53 20 22 34 30  | &0D..."EQUS "40|
00001330  20 6f 72 20 38 30 20 74  72 61 63 6b 73 3f 20 28  | or 80 tracks? (|
00001340  34 2f 38 29 20 22 0d 09  9c 07 42 52 4b 0d 09 a6  |4/8) "....BRK...|
00001350  0a 2e 72 65 61 64 79 0d  09 b0 0c 45 51 55 42 20  |..ready....EQUB |
00001360  26 30 44 0d 09 ba 22 45  51 55 53 20 22 52 65 61  |&0D..."EQUS "Rea|
00001370  64 79 20 74 6f 20 66 6f  72 6d 61 74 3f 20 28 59  |dy to format? (Y|
00001380  2f 4e 29 20 22 0d 09 c4  07 42 52 4b 0d 09 ce 0c  |/N) "....BRK....|
00001390  2e 61 6e 6f 74 68 65 72  0d 09 d8 0c 45 51 55 42  |.another....EQUB|
000013a0  20 26 30 44 0d 09 e2 1a  45 51 55 53 20 22 41 6e  | &0D....EQUS "An|
000013b0  6f 74 68 65 72 3f 20 28  59 2f 4e 29 20 22 0d 09  |other? (Y/N) "..|
000013c0  ec 07 42 52 4b 0d 09 f6  0a 2e 74 72 61 63 6b 0d  |..BRK.....track.|
000013d0  0a 00 24 45 51 55 42 20  26 30 30 20 5c 20 70 68  |..$EQUB &00 \ ph|
000013e0  79 73 69 63 61 6c 20 74  72 61 63 6b 20 6e 75 6d  |ysical track num|
000013f0  62 65 72 0d 0a 0a 0b 2e  66 69 6e 69 73 68 0d 0a  |ber.....finish..|
00001400  14 20 45 51 55 42 20 26  30 30 20 5c 20 6c 61 73  |. EQUB &00 \ las|
00001410  74 20 74 72 61 63 6b 20  6e 75 6d 62 65 72 0d 0a  |t track number..|
00001420  1e 0d 2e 6c 61 73 74 62  79 74 65 0d 0a 28 05 5d  |...lastbyte..(.]|
00001430  0d 0a 32 05 ed 0d 0a 3c  21 e8 27 22 53 61 76 65  |..2....<!.'"Save|
00001440  20 66 69 6c 65 6e 61 6d  65 20 3d 20 22 66 69 6c  | filename = "fil|
00001450  65 6e 61 6d 65 24 0d 0a  46 18 e7 20 66 69 6c 65  |ename$..F.. file|
00001460  6e 61 6d 65 24 20 3d 20  22 22 20 8c 20 e0 0d 0a  |name$ = "" . ...|
00001470  50 0b 2a 4f 50 54 31 2c  32 0d 0a 5a 61 ff 28 22  |P.*OPT1,2..Za.("|
00001480  53 41 56 45 20 22 2b 66  69 6c 65 6e 61 6d 65 24  |SAVE "+filename$|
00001490  2b 22 20 22 2b c3 7e 28  6d 63 6f 64 65 29 2b 22  |+" "+.~(mcode)+"|
000014a0  2b 22 2b c3 7e 28 6c 61  73 74 62 79 74 65 2d 66  |+"+.~(lastbyte-f|
000014b0  69 72 73 74 62 79 74 65  29 2b 22 20 22 2b c3 7e  |irstbyte)+" "+.~|
000014c0  28 73 74 61 72 74 29 2b  22 20 22 2b c3 7e 28 66  |(start)+" "+.~(f|
000014d0  69 72 73 74 62 79 74 65  29 29 0d 0a 64 0b 2a 4f  |irstbyte))..d.*O|
000014e0  50 54 31 2c 30 0d 0a 6e  05 e0 0d 0a 78 11 dd 20  |PT1,0..n....x.. |
000014f0  a4 66 69 6c 6c 28 73 69  7a 65 29 0d 0a 82 16 e3  |.fill(size).....|
00001500  20 63 6f 75 6e 74 20 3d  20 31 20 b8 20 73 69 7a  | count = 1 . siz|
00001510  65 0d 0a 8c 09 3f 4f 25  3d 30 0d 0a 96 0b 4f 25  |e....?O%=0....O%|
00001520  3d 4f 25 2b 31 0d 0a a0  0b 50 25 3d 50 25 2b 31  |=O%+1....P%=P%+1|
00001530  0d 0a aa 05 ed 0d 0a b4  09 3d 70 61 73 73 0d ff  |.........=pass..|
00001540
18-09-88/SECTOR5.m0
18-09-88/SECTOR5.m1
18-09-88/SECTOR5.m2
18-09-88/SECTOR5.m4
18-09-88/SECTOR5.m5