Home » CEEFAX disks » telesoftware9.adl » 11-09-88/OFFSET

11-09-88/OFFSET

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: 11-09-88/OFFSET
Read OK:
File size: 0E63 bytes
Load address: 0800
Exec address: 8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM: OFFSET
   20DIM mcode &400
   30oswrch=&FFEE
   40osnewl=&FFE7
   50osword=&FFF1
   60osbyte=&FFF4
   70FORpass=0 TO 2 STEP 2
   80P%=mcode
   90[OPT pass
  100JSR osnewl
  110.loop
  120LDA &FF \ poll escape flag
  130BPL noescape \ bit 7 set if Escape pressed
  140.escape
  150LDA #&7E
  160JSR osbyte \ acknowledge Escape
  170BRK
  180BRK
  190EQUS "Escape"
  200BRK
  210.noescape
  220LDA track \ load physical track number
  230STA block+7 \ store physical track number
  240BEQ endoffset \ don't offset track zero
  250LDX #36 \ logical track index
  260LDY #38 \ logical sector index
  270.inloop
  280LDA track \ load physical track number
  290STA table,X \ store logical track number
  300LDA shear \ load logical sector offset
  310BEQ zero \ branch if no offset
  320STA temp \ temporary store
  330.offsetloop
  340SEC
  350LDA table,Y \ load logical sector number
  360SBC #1 \ subtract 1
  370BPL positive
  380LDA #9
  390.positive
  400STA table,Y \ store logical sector number - 1
  410DEC temp \ decrement sector offset
  420BNE offsetloop \ offset again
  430.zero
  440DEX
  450DEX
  460TXA
  470TAY \ subtract 4 from Y register
  480DEX
  490DEX \ subtract 4 from X register
  500BPL inloop \ branch if less than 10 sectors
  510.endoffset
  520LDA #&7F
  530LDX #block MOD 256
  540LDY #block DIV 256
  550JSR osword \ format track
  560LDA block+12 \ load result byte
  570BNE error \ format OK if result = 0
  580JSR printtrack \ print track number
  590INC track \ increment track number
  600LDA track \ load track number
  610CMP finish \ is that the last track?
  620BCC loop \ branch if more tracks to format
  630LDA #&7F
  640LDX #catblock MOD 256
  650LDY #catblock DIV 256
  660JSR osword \ store empty catalogue
  670LDA catblock+10 \ check result byte
  680BNE error \ branch if not saved
  690RTS \ return to BASIC
  700.error
  710BRK
  720BRK
  730EQUS "Format error"
  740BRK
  750.printtrack
  760LDA track \ load track number
  770LSR A
  780LSR A
  790LSR A
  800LSR A \ isolate MS nybble
  810JSR nybble \ print MS nybble
  820LDA track \ load track number
  830JSR nybble \ print LS nybble
  840LDA #ASC(" ")
  850JSR oswrch \ print space
  860JMP oswrch \ print space
  870.nybble
  880AND #&0F
  890SED
  900CLC
  910ADC #&90
  920ADC #&40
  930CLD
  940JMP oswrch \ print nybble and return
  950.block
  960EQUB &00 \ drive number 0-3
  970EQUD table \ sector table
  980EQUB &05 \ 5 parameters
  990EQUB &63 \ format track
 1000EQUB &00 \ physical track number 0-79
 1010EQUB &15 \ gap 3
 1020EQUB &2A \ 10 sectors of 256 bytes
 1030EQUB &00 \ gap 5
 1040EQUB &10 \ gap 1
 1050EQUB &00 \ result byte
 1060.table
 1070EQUD &01000000
 1080EQUD &01010000
 1090EQUD &01020000
 1100EQUD &01030000
 1110EQUD &01040000
 1120EQUD &01050000
 1130EQUD &01060000
 1140EQUD &01070000
 1150EQUD &01080000
 1160EQUD &01090000
 1170.catalogue
 1180OPT FNfill(262)
 1190\ store 262 zeros
 1200.sectors
 1210EQUW &2003 \ &320 sectors (80 tracks)
 1220OPT FNfill(248)
 1230\ store 248 zeros
 1240.catblock
 1250EQUB &00 \ drive number 0 - 3
 1260EQUD catalogue \ address of buffer
 1270EQUB &03 \ number of parameters
 1280EQUB &4B \ write data multi-sector
 1290EQUB &00 \ logical track
 1300EQUB &00 \ start logical sector
 1310EQUB &22 \ 2 sectors of 256 bytes
 1320EQUB &00 \ result byte
 1330.track
 1340EQUB &00 \ physical track number
 1350.finish
 1360EQUB &00 \ number of tracks
 1370.shear
 1380EQUB &00 \ sector offset
 1390.temp
 1400EQUB &00 \ sector offset
 1410]
 1420NEXT
 1430REPEAT
 1440INPUT"Drive number (0-3) "D%
 1450UNTIL D%>-1 AND D%<4
 1460?block=D%
 1470?catblock=D%
 1480REPEAT
 1490INPUT"Number of tracks (40/80) "T%
 1500UNTIL T%=40 OR T%=80
 1510?finish=T%
 1520IF T%=40 THEN ?sectors=&01:sectors?1=&90
 1530REPEAT
 1540INPUT"Logical sector offset (0-9) "L%
 1550UNTIL L%>-1 AND L%<10
 1560?shear=L%
 1570INPUT"Ready to format? (Y/N) "yes$
 1580IF LEFT$(yes$,1)="Y" THEN CALL mcode
 1590INPUT'"Another disc? (Y/N) "yes$
 1600IF LEFT$(yes$,1)="Y" THEN RUN
 1610END
 1620DEF FNfill(size)
 1630FOR count = 1 TO size
 1640?P%=0
 1650P%=P%+1
 1660NEXT
 1670=pass


�: OFFSET
� mcode &400
oswrch=&FFEE
(osnewl=&FFE7
2osword=&FFF1
<osbyte=&FFF4
F�pass=0 � 2 � 2
PP%=mcode
Z
[OPT pass
dJSR osnewl
n	.loop
xLDA &FF \ poll escape flag
�.BPL noescape \ bit 7 set if Escape pressed
�.escape
�LDA #&7E
�#JSR osbyte \ acknowledge Escape
�BRK
�BRK
�EQUS "Escape"
�BRK
�
.noescape
�*LDA track \ load physical track number
�-STA block+7 \ store physical track number
�+BEQ endoffset \ don't offset track zero
�!LDX #36 \ logical track index
"LDY #38 \ logical sector index
.inloop
*LDA track \ load physical track number
",STA table,X \ store logical track number
,*LDA shear \ load logical sector offset
6"BEQ zero \ branch if no offset
@STA temp \ temporary store
J.offsetloop
TSEC
^,LDA table,Y \ load logical sector number
hSBC #1 \ subtract 1
rBPL positive
|
LDA #9
�
.positive
�1STA table,Y \ store logical sector number - 1
�&DEC temp \ decrement sector offset
�!BNE offsetloop \ offset again
�	.zero
�DEX
�DEX
�TXA
�$TAY \ subtract 4 from Y register
�DEX
�$DEX \ subtract 4 from X register
�/BPL inloop \ branch if less than 10 sectors
�.endoffset
LDA #&7F
LDX #block � 256
LDY #block � 256
&JSR osword \ format track
0#LDA block+12 \ load result byte
:'BNE error \ format OK if result = 0
D'JSR printtrack \ print track number
N&INC track \ increment track number
X!LDA track \ load track number
b(CMP finish \ is that the last track?
l.BCC loop \ branch if more tracks to format
vLDA #&7F
�LDX #catblock � 256
�LDY #catblock � 256
�&JSR osword \ store empty catalogue
�'LDA catblock+10 \ check result byte
�#BNE error \ branch if not saved
�RTS \ return to BASIC
�
.error
�BRK
�BRK
�EQUS "Format error"
�BRK
�.printtrack
�!LDA track \ load track number
	LSR A
	LSR A
	LSR A
 LSR A \ isolate MS nybble
* JSR nybble \ print MS nybble
4!LDA track \ load track number
> JSR nybble \ print LS nybble
HLDA #�(" ")
RJSR oswrch \ print space
\JMP oswrch \ print space
f.nybble
p
� #&0F
zSED
�CLC
�ADC #&90
�ADC #&40
�CLD
�(JMP oswrch \ print nybble and return
�
.block
�EQUB &00 \ drive number 0-3
�EQUD table \ sector table
�EQUB &05 \ 5 parameters
�EQUB &63 \ format track
�)EQUB &00 \ physical track number 0-79
�EQUB &15 \ gap 3
�&EQUB &2A \ 10 sectors of 256 bytes
EQUB &00 \ gap 5
EQUB &10 \ gap 1
EQUB &00 \ result byte
$
.table
.EQUD &01000000
8EQUD &01010000
BEQUD &01020000
LEQUD &01030000
VEQUD &01040000
`EQUD &01050000
jEQUD &01060000
tEQUD &01070000
~EQUD &01080000
�EQUD &01090000
�.catalogue
�OPT �fill(262)
�\ store 262 zeros
�.sectors
�)EQUW &2003 \ &320 sectors (80 tracks)
�OPT �fill(248)
�\ store 248 zeros
�
.catblock
�!EQUB &00 \ drive number 0 - 3
�&EQUD catalogue \ address of buffer
�#EQUB &03 \ number of parameters
&EQUB &4B \ write data multi-sector

EQUB &00 \ logical track
#EQUB &00 \ start logical sector
%EQUB &22 \ 2 sectors of 256 bytes
(EQUB &00 \ result byte
2
.track
<$EQUB &00 \ physical track number
F.finish
PEQUB &00 \ number of tracks
Z
.shear
dEQUB &00 \ sector offset
n	.temp
xEQUB &00 \ sector offset
�]
��
��
��"Drive number (0-3) "D%
�� D%>-1 � D%<4
�
?block=D%
�?catblock=D%
��
�"�"Number of tracks (40/80) "T%
�� T%=40 � T%=80
�?finish=T%
�(� T%=40 � ?sectors=&01:sectors?1=&90
��
%�"Logical sector offset (0-9) "L%
� L%>-1 � L%<10

?shear=L%
""�"Ready to format? (Y/N) "yes$
,� �yes$,1)="Y" � � mcode
6 �'"Another disc? (Y/N) "yes$
@� �yes$,1)="Y" � �
J�
T� �fill(size)
^� count = 1 � size
h	?P%=0
rP%=P%+1
|�
�	=pass
�
00000000  0d 00 0a 0d f4 3a 20 4f  46 46 53 45 54 0d 00 14  |.....: OFFSET...|
00000010  10 de 20 6d 63 6f 64 65  20 26 34 30 30 0d 00 1e  |.. mcode &400...|
00000020  10 6f 73 77 72 63 68 3d  26 46 46 45 45 0d 00 28  |.oswrch=&FFEE..(|
00000030  10 6f 73 6e 65 77 6c 3d  26 46 46 45 37 0d 00 32  |.osnewl=&FFE7..2|
00000040  10 6f 73 77 6f 72 64 3d  26 46 46 46 31 0d 00 3c  |.osword=&FFF1..<|
00000050  10 6f 73 62 79 74 65 3d  26 46 46 46 34 0d 00 46  |.osbyte=&FFF4..F|
00000060  13 e3 70 61 73 73 3d 30  20 b8 20 32 20 88 20 32  |..pass=0 . 2 . 2|
00000070  0d 00 50 0c 50 25 3d 6d  63 6f 64 65 0d 00 5a 0d  |..P.P%=mcode..Z.|
00000080  5b 4f 50 54 20 70 61 73  73 0d 00 64 0e 4a 53 52  |[OPT pass..d.JSR|
00000090  20 6f 73 6e 65 77 6c 0d  00 6e 09 2e 6c 6f 6f 70  | osnewl..n..loop|
000000a0  0d 00 78 1e 4c 44 41 20  26 46 46 20 5c 20 70 6f  |..x.LDA &FF \ po|
000000b0  6c 6c 20 65 73 63 61 70  65 20 66 6c 61 67 0d 00  |ll escape flag..|
000000c0  82 2e 42 50 4c 20 6e 6f  65 73 63 61 70 65 20 5c  |..BPL noescape \|
000000d0  20 62 69 74 20 37 20 73  65 74 20 69 66 20 45 73  | bit 7 set if Es|
000000e0  63 61 70 65 20 70 72 65  73 73 65 64 0d 00 8c 0b  |cape pressed....|
000000f0  2e 65 73 63 61 70 65 0d  00 96 0c 4c 44 41 20 23  |.escape....LDA #|
00000100  26 37 45 0d 00 a0 23 4a  53 52 20 6f 73 62 79 74  |&7E...#JSR osbyt|
00000110  65 20 5c 20 61 63 6b 6e  6f 77 6c 65 64 67 65 20  |e \ acknowledge |
00000120  45 73 63 61 70 65 0d 00  aa 07 42 52 4b 0d 00 b4  |Escape....BRK...|
00000130  07 42 52 4b 0d 00 be 11  45 51 55 53 20 22 45 73  |.BRK....EQUS "Es|
00000140  63 61 70 65 22 0d 00 c8  07 42 52 4b 0d 00 d2 0d  |cape"....BRK....|
00000150  2e 6e 6f 65 73 63 61 70  65 0d 00 dc 2a 4c 44 41  |.noescape...*LDA|
00000160  20 74 72 61 63 6b 20 5c  20 6c 6f 61 64 20 70 68  | track \ load ph|
00000170  79 73 69 63 61 6c 20 74  72 61 63 6b 20 6e 75 6d  |ysical track num|
00000180  62 65 72 0d 00 e6 2d 53  54 41 20 62 6c 6f 63 6b  |ber...-STA block|
00000190  2b 37 20 5c 20 73 74 6f  72 65 20 70 68 79 73 69  |+7 \ store physi|
000001a0  63 61 6c 20 74 72 61 63  6b 20 6e 75 6d 62 65 72  |cal track number|
000001b0  0d 00 f0 2b 42 45 51 20  65 6e 64 6f 66 66 73 65  |...+BEQ endoffse|
000001c0  74 20 5c 20 64 6f 6e 27  74 20 6f 66 66 73 65 74  |t \ don't offset|
000001d0  20 74 72 61 63 6b 20 7a  65 72 6f 0d 00 fa 21 4c  | track zero...!L|
000001e0  44 58 20 23 33 36 20 5c  20 6c 6f 67 69 63 61 6c  |DX #36 \ logical|
000001f0  20 74 72 61 63 6b 20 69  6e 64 65 78 0d 01 04 22  | track index..."|
00000200  4c 44 59 20 23 33 38 20  5c 20 6c 6f 67 69 63 61  |LDY #38 \ logica|
00000210  6c 20 73 65 63 74 6f 72  20 69 6e 64 65 78 0d 01  |l sector index..|
00000220  0e 0b 2e 69 6e 6c 6f 6f  70 0d 01 18 2a 4c 44 41  |...inloop...*LDA|
00000230  20 74 72 61 63 6b 20 5c  20 6c 6f 61 64 20 70 68  | track \ load ph|
00000240  79 73 69 63 61 6c 20 74  72 61 63 6b 20 6e 75 6d  |ysical track num|
00000250  62 65 72 0d 01 22 2c 53  54 41 20 74 61 62 6c 65  |ber..",STA table|
00000260  2c 58 20 5c 20 73 74 6f  72 65 20 6c 6f 67 69 63  |,X \ store logic|
00000270  61 6c 20 74 72 61 63 6b  20 6e 75 6d 62 65 72 0d  |al track number.|
00000280  01 2c 2a 4c 44 41 20 73  68 65 61 72 20 5c 20 6c  |.,*LDA shear \ l|
00000290  6f 61 64 20 6c 6f 67 69  63 61 6c 20 73 65 63 74  |oad logical sect|
000002a0  6f 72 20 6f 66 66 73 65  74 0d 01 36 22 42 45 51  |or offset..6"BEQ|
000002b0  20 7a 65 72 6f 20 5c 20  62 72 61 6e 63 68 20 69  | zero \ branch i|
000002c0  66 20 6e 6f 20 6f 66 66  73 65 74 0d 01 40 1e 53  |f no offset..@.S|
000002d0  54 41 20 74 65 6d 70 20  5c 20 74 65 6d 70 6f 72  |TA temp \ tempor|
000002e0  61 72 79 20 73 74 6f 72  65 0d 01 4a 0f 2e 6f 66  |ary store..J..of|
000002f0  66 73 65 74 6c 6f 6f 70  0d 01 54 07 53 45 43 0d  |fsetloop..T.SEC.|
00000300  01 5e 2c 4c 44 41 20 74  61 62 6c 65 2c 59 20 5c  |.^,LDA table,Y \|
00000310  20 6c 6f 61 64 20 6c 6f  67 69 63 61 6c 20 73 65  | load logical se|
00000320  63 74 6f 72 20 6e 75 6d  62 65 72 0d 01 68 17 53  |ctor number..h.S|
00000330  42 43 20 23 31 20 5c 20  73 75 62 74 72 61 63 74  |BC #1 \ subtract|
00000340  20 31 0d 01 72 10 42 50  4c 20 70 6f 73 69 74 69  | 1..r.BPL positi|
00000350  76 65 0d 01 7c 0a 4c 44  41 20 23 39 0d 01 86 0d  |ve..|.LDA #9....|
00000360  2e 70 6f 73 69 74 69 76  65 0d 01 90 31 53 54 41  |.positive...1STA|
00000370  20 74 61 62 6c 65 2c 59  20 5c 20 73 74 6f 72 65  | table,Y \ store|
00000380  20 6c 6f 67 69 63 61 6c  20 73 65 63 74 6f 72 20  | logical sector |
00000390  6e 75 6d 62 65 72 20 2d  20 31 0d 01 9a 26 44 45  |number - 1...&DE|
000003a0  43 20 74 65 6d 70 20 5c  20 64 65 63 72 65 6d 65  |C temp \ decreme|
000003b0  6e 74 20 73 65 63 74 6f  72 20 6f 66 66 73 65 74  |nt sector offset|
000003c0  0d 01 a4 21 42 4e 45 20  6f 66 66 73 65 74 6c 6f  |...!BNE offsetlo|
000003d0  6f 70 20 5c 20 6f 66 66  73 65 74 20 61 67 61 69  |op \ offset agai|
000003e0  6e 0d 01 ae 09 2e 7a 65  72 6f 0d 01 b8 07 44 45  |n.....zero....DE|
000003f0  58 0d 01 c2 07 44 45 58  0d 01 cc 07 54 58 41 0d  |X....DEX....TXA.|
00000400  01 d6 24 54 41 59 20 5c  20 73 75 62 74 72 61 63  |..$TAY \ subtrac|
00000410  74 20 34 20 66 72 6f 6d  20 59 20 72 65 67 69 73  |t 4 from Y regis|
00000420  74 65 72 0d 01 e0 07 44  45 58 0d 01 ea 24 44 45  |ter....DEX...$DE|
00000430  58 20 5c 20 73 75 62 74  72 61 63 74 20 34 20 66  |X \ subtract 4 f|
00000440  72 6f 6d 20 58 20 72 65  67 69 73 74 65 72 0d 01  |rom X register..|
00000450  f4 2f 42 50 4c 20 69 6e  6c 6f 6f 70 20 5c 20 62  |./BPL inloop \ b|
00000460  72 61 6e 63 68 20 69 66  20 6c 65 73 73 20 74 68  |ranch if less th|
00000470  61 6e 20 31 30 20 73 65  63 74 6f 72 73 0d 01 fe  |an 10 sectors...|
00000480  0e 2e 65 6e 64 6f 66 66  73 65 74 0d 02 08 0c 4c  |..endoffset....L|
00000490  44 41 20 23 26 37 46 0d  02 12 14 4c 44 58 20 23  |DA #&7F....LDX #|
000004a0  62 6c 6f 63 6b 20 83 20  32 35 36 0d 02 1c 14 4c  |block . 256....L|
000004b0  44 59 20 23 62 6c 6f 63  6b 20 81 20 32 35 36 0d  |DY #block . 256.|
000004c0  02 26 1d 4a 53 52 20 6f  73 77 6f 72 64 20 5c 20  |.&.JSR osword \ |
000004d0  66 6f 72 6d 61 74 20 74  72 61 63 6b 0d 02 30 23  |format track..0#|
000004e0  4c 44 41 20 62 6c 6f 63  6b 2b 31 32 20 5c 20 6c  |LDA block+12 \ l|
000004f0  6f 61 64 20 72 65 73 75  6c 74 20 62 79 74 65 0d  |oad result byte.|
00000500  02 3a 27 42 4e 45 20 65  72 72 6f 72 20 5c 20 66  |.:'BNE error \ f|
00000510  6f 72 6d 61 74 20 4f 4b  20 69 66 20 72 65 73 75  |ormat OK if resu|
00000520  6c 74 20 3d 20 30 0d 02  44 27 4a 53 52 20 70 72  |lt = 0..D'JSR pr|
00000530  69 6e 74 74 72 61 63 6b  20 5c 20 70 72 69 6e 74  |inttrack \ print|
00000540  20 74 72 61 63 6b 20 6e  75 6d 62 65 72 0d 02 4e  | track number..N|
00000550  26 49 4e 43 20 74 72 61  63 6b 20 5c 20 69 6e 63  |&INC track \ inc|
00000560  72 65 6d 65 6e 74 20 74  72 61 63 6b 20 6e 75 6d  |rement track num|
00000570  62 65 72 0d 02 58 21 4c  44 41 20 74 72 61 63 6b  |ber..X!LDA track|
00000580  20 5c 20 6c 6f 61 64 20  74 72 61 63 6b 20 6e 75  | \ load track nu|
00000590  6d 62 65 72 0d 02 62 28  43 4d 50 20 66 69 6e 69  |mber..b(CMP fini|
000005a0  73 68 20 5c 20 69 73 20  74 68 61 74 20 74 68 65  |sh \ is that the|
000005b0  20 6c 61 73 74 20 74 72  61 63 6b 3f 0d 02 6c 2e  | last track?..l.|
000005c0  42 43 43 20 6c 6f 6f 70  20 5c 20 62 72 61 6e 63  |BCC loop \ branc|
000005d0  68 20 69 66 20 6d 6f 72  65 20 74 72 61 63 6b 73  |h if more tracks|
000005e0  20 74 6f 20 66 6f 72 6d  61 74 0d 02 76 0c 4c 44  | to format..v.LD|
000005f0  41 20 23 26 37 46 0d 02  80 17 4c 44 58 20 23 63  |A #&7F....LDX #c|
00000600  61 74 62 6c 6f 63 6b 20  83 20 32 35 36 0d 02 8a  |atblock . 256...|
00000610  17 4c 44 59 20 23 63 61  74 62 6c 6f 63 6b 20 81  |.LDY #catblock .|
00000620  20 32 35 36 0d 02 94 26  4a 53 52 20 6f 73 77 6f  | 256...&JSR oswo|
00000630  72 64 20 5c 20 73 74 6f  72 65 20 65 6d 70 74 79  |rd \ store empty|
00000640  20 63 61 74 61 6c 6f 67  75 65 0d 02 9e 27 4c 44  | catalogue...'LD|
00000650  41 20 63 61 74 62 6c 6f  63 6b 2b 31 30 20 5c 20  |A catblock+10 \ |
00000660  63 68 65 63 6b 20 72 65  73 75 6c 74 20 62 79 74  |check result byt|
00000670  65 0d 02 a8 23 42 4e 45  20 65 72 72 6f 72 20 5c  |e...#BNE error \|
00000680  20 62 72 61 6e 63 68 20  69 66 20 6e 6f 74 20 73  | branch if not s|
00000690  61 76 65 64 0d 02 b2 19  52 54 53 20 5c 20 72 65  |aved....RTS \ re|
000006a0  74 75 72 6e 20 74 6f 20  42 41 53 49 43 0d 02 bc  |turn to BASIC...|
000006b0  0a 2e 65 72 72 6f 72 0d  02 c6 07 42 52 4b 0d 02  |..error....BRK..|
000006c0  d0 07 42 52 4b 0d 02 da  17 45 51 55 53 20 22 46  |..BRK....EQUS "F|
000006d0  6f 72 6d 61 74 20 65 72  72 6f 72 22 0d 02 e4 07  |ormat error"....|
000006e0  42 52 4b 0d 02 ee 0f 2e  70 72 69 6e 74 74 72 61  |BRK.....printtra|
000006f0  63 6b 0d 02 f8 21 4c 44  41 20 74 72 61 63 6b 20  |ck...!LDA track |
00000700  5c 20 6c 6f 61 64 20 74  72 61 63 6b 20 6e 75 6d  |\ load track num|
00000710  62 65 72 0d 03 02 09 4c  53 52 20 41 0d 03 0c 09  |ber....LSR A....|
00000720  4c 53 52 20 41 0d 03 16  09 4c 53 52 20 41 0d 03  |LSR A....LSR A..|
00000730  20 1d 4c 53 52 20 41 20  5c 20 69 73 6f 6c 61 74  | .LSR A \ isolat|
00000740  65 20 4d 53 20 6e 79 62  62 6c 65 0d 03 2a 20 4a  |e MS nybble..* J|
00000750  53 52 20 6e 79 62 62 6c  65 20 5c 20 70 72 69 6e  |SR nybble \ prin|
00000760  74 20 4d 53 20 6e 79 62  62 6c 65 0d 03 34 21 4c  |t MS nybble..4!L|
00000770  44 41 20 74 72 61 63 6b  20 5c 20 6c 6f 61 64 20  |DA track \ load |
00000780  74 72 61 63 6b 20 6e 75  6d 62 65 72 0d 03 3e 20  |track number..> |
00000790  4a 53 52 20 6e 79 62 62  6c 65 20 5c 20 70 72 69  |JSR nybble \ pri|
000007a0  6e 74 20 4c 53 20 6e 79  62 62 6c 65 0d 03 48 0f  |nt LS nybble..H.|
000007b0  4c 44 41 20 23 97 28 22  20 22 29 0d 03 52 1c 4a  |LDA #.(" ")..R.J|
000007c0  53 52 20 6f 73 77 72 63  68 20 5c 20 70 72 69 6e  |SR oswrch \ prin|
000007d0  74 20 73 70 61 63 65 0d  03 5c 1c 4a 4d 50 20 6f  |t space..\.JMP o|
000007e0  73 77 72 63 68 20 5c 20  70 72 69 6e 74 20 73 70  |swrch \ print sp|
000007f0  61 63 65 0d 03 66 0b 2e  6e 79 62 62 6c 65 0d 03  |ace..f..nybble..|
00000800  70 0a 80 20 23 26 30 46  0d 03 7a 07 53 45 44 0d  |p.. #&0F..z.SED.|
00000810  03 84 07 43 4c 43 0d 03  8e 0c 41 44 43 20 23 26  |...CLC....ADC #&|
00000820  39 30 0d 03 98 0c 41 44  43 20 23 26 34 30 0d 03  |90....ADC #&40..|
00000830  a2 07 43 4c 44 0d 03 ac  28 4a 4d 50 20 6f 73 77  |..CLD...(JMP osw|
00000840  72 63 68 20 5c 20 70 72  69 6e 74 20 6e 79 62 62  |rch \ print nybb|
00000850  6c 65 20 61 6e 64 20 72  65 74 75 72 6e 0d 03 b6  |le and return...|
00000860  0a 2e 62 6c 6f 63 6b 0d  03 c0 1f 45 51 55 42 20  |..block....EQUB |
00000870  26 30 30 20 5c 20 64 72  69 76 65 20 6e 75 6d 62  |&00 \ drive numb|
00000880  65 72 20 30 2d 33 0d 03  ca 1d 45 51 55 44 20 74  |er 0-3....EQUD t|
00000890  61 62 6c 65 20 5c 20 73  65 63 74 6f 72 20 74 61  |able \ sector ta|
000008a0  62 6c 65 0d 03 d4 1b 45  51 55 42 20 26 30 35 20  |ble....EQUB &05 |
000008b0  5c 20 35 20 70 61 72 61  6d 65 74 65 72 73 0d 03  |\ 5 parameters..|
000008c0  de 1b 45 51 55 42 20 26  36 33 20 5c 20 66 6f 72  |..EQUB &63 \ for|
000008d0  6d 61 74 20 74 72 61 63  6b 0d 03 e8 29 45 51 55  |mat track...)EQU|
000008e0  42 20 26 30 30 20 5c 20  70 68 79 73 69 63 61 6c  |B &00 \ physical|
000008f0  20 74 72 61 63 6b 20 6e  75 6d 62 65 72 20 30 2d  | track number 0-|
00000900  37 39 0d 03 f2 14 45 51  55 42 20 26 31 35 20 5c  |79....EQUB &15 \|
00000910  20 67 61 70 20 33 0d 03  fc 26 45 51 55 42 20 26  | gap 3...&EQUB &|
00000920  32 41 20 5c 20 31 30 20  73 65 63 74 6f 72 73 20  |2A \ 10 sectors |
00000930  6f 66 20 32 35 36 20 62  79 74 65 73 0d 04 06 14  |of 256 bytes....|
00000940  45 51 55 42 20 26 30 30  20 5c 20 67 61 70 20 35  |EQUB &00 \ gap 5|
00000950  0d 04 10 14 45 51 55 42  20 26 31 30 20 5c 20 67  |....EQUB &10 \ g|
00000960  61 70 20 31 0d 04 1a 1a  45 51 55 42 20 26 30 30  |ap 1....EQUB &00|
00000970  20 5c 20 72 65 73 75 6c  74 20 62 79 74 65 0d 04  | \ result byte..|
00000980  24 0a 2e 74 61 62 6c 65  0d 04 2e 12 45 51 55 44  |$..table....EQUD|
00000990  20 26 30 31 30 30 30 30  30 30 0d 04 38 12 45 51  | &01000000..8.EQ|
000009a0  55 44 20 26 30 31 30 31  30 30 30 30 0d 04 42 12  |UD &01010000..B.|
000009b0  45 51 55 44 20 26 30 31  30 32 30 30 30 30 0d 04  |EQUD &01020000..|
000009c0  4c 12 45 51 55 44 20 26  30 31 30 33 30 30 30 30  |L.EQUD &01030000|
000009d0  0d 04 56 12 45 51 55 44  20 26 30 31 30 34 30 30  |..V.EQUD &010400|
000009e0  30 30 0d 04 60 12 45 51  55 44 20 26 30 31 30 35  |00..`.EQUD &0105|
000009f0  30 30 30 30 0d 04 6a 12  45 51 55 44 20 26 30 31  |0000..j.EQUD &01|
00000a00  30 36 30 30 30 30 0d 04  74 12 45 51 55 44 20 26  |060000..t.EQUD &|
00000a10  30 31 30 37 30 30 30 30  0d 04 7e 12 45 51 55 44  |01070000..~.EQUD|
00000a20  20 26 30 31 30 38 30 30  30 30 0d 04 88 12 45 51  | &01080000....EQ|
00000a30  55 44 20 26 30 31 30 39  30 30 30 30 0d 04 92 0e  |UD &01090000....|
00000a40  2e 63 61 74 61 6c 6f 67  75 65 0d 04 9c 12 4f 50  |.catalogue....OP|
00000a50  54 20 a4 66 69 6c 6c 28  32 36 32 29 0d 04 a6 15  |T .fill(262)....|
00000a60  5c 20 73 74 6f 72 65 20  32 36 32 20 7a 65 72 6f  |\ store 262 zero|
00000a70  73 0d 04 b0 0c 2e 73 65  63 74 6f 72 73 0d 04 ba  |s.....sectors...|
00000a80  29 45 51 55 57 20 26 32  30 30 33 20 5c 20 26 33  |)EQUW &2003 \ &3|
00000a90  32 30 20 73 65 63 74 6f  72 73 20 28 38 30 20 74  |20 sectors (80 t|
00000aa0  72 61 63 6b 73 29 0d 04  c4 12 4f 50 54 20 a4 66  |racks)....OPT .f|
00000ab0  69 6c 6c 28 32 34 38 29  0d 04 ce 15 5c 20 73 74  |ill(248)....\ st|
00000ac0  6f 72 65 20 32 34 38 20  7a 65 72 6f 73 0d 04 d8  |ore 248 zeros...|
00000ad0  0d 2e 63 61 74 62 6c 6f  63 6b 0d 04 e2 21 45 51  |..catblock...!EQ|
00000ae0  55 42 20 26 30 30 20 5c  20 64 72 69 76 65 20 6e  |UB &00 \ drive n|
00000af0  75 6d 62 65 72 20 30 20  2d 20 33 0d 04 ec 26 45  |umber 0 - 3...&E|
00000b00  51 55 44 20 63 61 74 61  6c 6f 67 75 65 20 5c 20  |QUD catalogue \ |
00000b10  61 64 64 72 65 73 73 20  6f 66 20 62 75 66 66 65  |address of buffe|
00000b20  72 0d 04 f6 23 45 51 55  42 20 26 30 33 20 5c 20  |r...#EQUB &03 \ |
00000b30  6e 75 6d 62 65 72 20 6f  66 20 70 61 72 61 6d 65  |number of parame|
00000b40  74 65 72 73 0d 05 00 26  45 51 55 42 20 26 34 42  |ters...&EQUB &4B|
00000b50  20 5c 20 77 72 69 74 65  20 64 61 74 61 20 6d 75  | \ write data mu|
00000b60  6c 74 69 2d 73 65 63 74  6f 72 0d 05 0a 1c 45 51  |lti-sector....EQ|
00000b70  55 42 20 26 30 30 20 5c  20 6c 6f 67 69 63 61 6c  |UB &00 \ logical|
00000b80  20 74 72 61 63 6b 0d 05  14 23 45 51 55 42 20 26  | track...#EQUB &|
00000b90  30 30 20 5c 20 73 74 61  72 74 20 6c 6f 67 69 63  |00 \ start logic|
00000ba0  61 6c 20 73 65 63 74 6f  72 0d 05 1e 25 45 51 55  |al sector...%EQU|
00000bb0  42 20 26 32 32 20 5c 20  32 20 73 65 63 74 6f 72  |B &22 \ 2 sector|
00000bc0  73 20 6f 66 20 32 35 36  20 62 79 74 65 73 0d 05  |s of 256 bytes..|
00000bd0  28 1a 45 51 55 42 20 26  30 30 20 5c 20 72 65 73  |(.EQUB &00 \ res|
00000be0  75 6c 74 20 62 79 74 65  0d 05 32 0a 2e 74 72 61  |ult byte..2..tra|
00000bf0  63 6b 0d 05 3c 24 45 51  55 42 20 26 30 30 20 5c  |ck..<$EQUB &00 \|
00000c00  20 70 68 79 73 69 63 61  6c 20 74 72 61 63 6b 20  | physical track |
00000c10  6e 75 6d 62 65 72 0d 05  46 0b 2e 66 69 6e 69 73  |number..F..finis|
00000c20  68 0d 05 50 1f 45 51 55  42 20 26 30 30 20 5c 20  |h..P.EQUB &00 \ |
00000c30  6e 75 6d 62 65 72 20 6f  66 20 74 72 61 63 6b 73  |number of tracks|
00000c40  0d 05 5a 0a 2e 73 68 65  61 72 0d 05 64 1c 45 51  |..Z..shear..d.EQ|
00000c50  55 42 20 26 30 30 20 5c  20 73 65 63 74 6f 72 20  |UB &00 \ sector |
00000c60  6f 66 66 73 65 74 0d 05  6e 09 2e 74 65 6d 70 0d  |offset..n..temp.|
00000c70  05 78 1c 45 51 55 42 20  26 30 30 20 5c 20 73 65  |.x.EQUB &00 \ se|
00000c80  63 74 6f 72 20 6f 66 66  73 65 74 0d 05 82 05 5d  |ctor offset....]|
00000c90  0d 05 8c 05 ed 0d 05 96  05 f5 0d 05 a0 1c e8 22  |..............."|
00000ca0  44 72 69 76 65 20 6e 75  6d 62 65 72 20 28 30 2d  |Drive number (0-|
00000cb0  33 29 20 22 44 25 0d 05  aa 12 fd 20 44 25 3e 2d  |3) "D%..... D%>-|
00000cc0  31 20 80 20 44 25 3c 34  0d 05 b4 0d 3f 62 6c 6f  |1 . D%<4....?blo|
00000cd0  63 6b 3d 44 25 0d 05 be  10 3f 63 61 74 62 6c 6f  |ck=D%....?catblo|
00000ce0  63 6b 3d 44 25 0d 05 c8  05 f5 0d 05 d2 22 e8 22  |ck=D%........"."|
00000cf0  4e 75 6d 62 65 72 20 6f  66 20 74 72 61 63 6b 73  |Number of tracks|
00000d00  20 28 34 30 2f 38 30 29  20 22 54 25 0d 05 dc 13  | (40/80) "T%....|
00000d10  fd 20 54 25 3d 34 30 20  84 20 54 25 3d 38 30 0d  |. T%=40 . T%=80.|
00000d20  05 e6 0e 3f 66 69 6e 69  73 68 3d 54 25 0d 05 f0  |...?finish=T%...|
00000d30  28 e7 20 54 25 3d 34 30  20 8c 20 3f 73 65 63 74  |(. T%=40 . ?sect|
00000d40  6f 72 73 3d 26 30 31 3a  73 65 63 74 6f 72 73 3f  |ors=&01:sectors?|
00000d50  31 3d 26 39 30 0d 05 fa  05 f5 0d 06 04 25 e8 22  |1=&90........%."|
00000d60  4c 6f 67 69 63 61 6c 20  73 65 63 74 6f 72 20 6f  |Logical sector o|
00000d70  66 66 73 65 74 20 28 30  2d 39 29 20 22 4c 25 0d  |ffset (0-9) "L%.|
00000d80  06 0e 13 fd 20 4c 25 3e  2d 31 20 80 20 4c 25 3c  |.... L%>-1 . L%<|
00000d90  31 30 0d 06 18 0d 3f 73  68 65 61 72 3d 4c 25 0d  |10....?shear=L%.|
00000da0  06 22 22 e8 22 52 65 61  64 79 20 74 6f 20 66 6f  |.""."Ready to fo|
00000db0  72 6d 61 74 3f 20 28 59  2f 4e 29 20 22 79 65 73  |rmat? (Y/N) "yes|
00000dc0  24 0d 06 2c 1c e7 20 c0  79 65 73 24 2c 31 29 3d  |$..,.. .yes$,1)=|
00000dd0  22 59 22 20 8c 20 d6 20  6d 63 6f 64 65 0d 06 36  |"Y" . . mcode..6|
00000de0  20 e8 27 22 41 6e 6f 74  68 65 72 20 64 69 73 63  | .'"Another disc|
00000df0  3f 20 28 59 2f 4e 29 20  22 79 65 73 24 0d 06 40  |? (Y/N) "yes$..@|
00000e00  16 e7 20 c0 79 65 73 24  2c 31 29 3d 22 59 22 20  |.. .yes$,1)="Y" |
00000e10  8c 20 f9 0d 06 4a 05 e0  0d 06 54 11 dd 20 a4 66  |. ...J....T.. .f|
00000e20  69 6c 6c 28 73 69 7a 65  29 0d 06 5e 16 e3 20 63  |ill(size)..^.. c|
00000e30  6f 75 6e 74 20 3d 20 31  20 b8 20 73 69 7a 65 0d  |ount = 1 . size.|
00000e40  06 68 09 3f 50 25 3d 30  0d 06 72 0b 50 25 3d 50  |.h.?P%=0..r.P%=P|
00000e50  25 2b 31 0d 06 7c 05 ed  0d 06 86 09 3d 70 61 73  |%+1..|......=pas|
00000e60  73 0d ff                                          |s..|
00000e63
11-09-88/OFFSET.m0
11-09-88/OFFSET.m1
11-09-88/OFFSET.m2
11-09-88/OFFSET.m4
11-09-88/OFFSET.m5