Home » CEEFAX disks » telesoftware9.adl » 18-09-88/T\DFS06

18-09-88/T\DFS06

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/T\DFS06
Read OK:
File size: 5392 bytes
Load address: 0000
Exec address: FFFFFFFF
File contents
The Acorn DFS Osword commands  -  by  -  Gordon Horsington
----------------------------------------------------------

Module 6. Creating copy-protected single density discs
------------------------------------------------------

      +----------------------------------------------------------+
      | All the DFS modules in  this  series  use programs which |
      | experiment  with the format and contents of discs. These |
      | experiments may  have disasterous effects if you use any |
      | of the programs  on  discs  which store programs or data |
      | which you cannot afford to lose.  You  should  first try |
      | out  the  programs  using  discs  that  have either been |
      | duplicated or, better still, have not been used at all.  |
      +----------------------------------------------------------+


In this module I will describe in detail one method of producing copy-
protected single density discs. This type of disc is designed to prevent
other people seeing how your programs work and to stop them duplicating
the disc. Meeting the first objective is relatively easy. Meeting the
second objective is virtually impossible. It is easy to prevent amateur
piracy using duplicating programs but you will never be able to stop a
determined hacker undoing all your efforts to prevent duplication. I have
not yet found a commercially produced copy-protected disc for the BBC
range of computers which can not have all the protection removed so that
the disc can be duplicated with the *BACKUP command.

If you choose to copy-protect your discs you will at least indicate to the
users of your software that you are unwilling to have the disc duplicated.
To stand the best chance of defeating a hacker you should use the method
described in this module as a starting point for developing your own ideas
about protection. Remember that everyone reading this module will know how
to undo the protection by just reversing the steps in the procedure. You
should at least aim to produce a disc which cannot be duplicated by either
of the two disc duplicators described in the next module. This will not be
easy but all the information you need to do it has been or will be
presented in this series. You might like to consider using Bad Tracks,
Unusual logical sector numbers and logical track numbers in unexpected
combinations, encrypted machine code programs and multiple files which use
unusual methods of writing to and reading from the disc. What you do is up
to you but you must try to think like a hacker if you want to prevent your
software being hacked.

The method used to introduce copy-protection will use a single density
disc formatted with 5 sectors per track instead of the usual 10 sectors
per track. The data will be stored on the disc using the Write Deleted
Data command as an extra protection.

A disc cannot be formatted with 5 sectors per track using the DFS
formatter and so the first step in this procedure will be to write a
special disc formatting program. The program SECTOR5 can be used to
produce an object code file which, in turn, can be used to produce a
single density disc with a standard track &00 and the rest of the disc
formatted with 5 sectors on every track. Each of the non-standard tracks
is capable of storing 2.5k of data in 5 sectors, ie. 512 bytes per sector.
The object code file produced by SECTOR5 is exactly 1k long and can be
stored in two of the 512 byte sectors. I will use this object code file as
an example for producing the required copy-protected disc.

Run the program SECTOR5 and, when prompted, give a suitable filename for
the object code file. In the rest of this module I will refer to the
object code file produced by SECTOR5 as FORM5.


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


There are a number of points worth noting about the program SECTOR5. The
object code is used to create a 5 sector per track formatted disc and, for
the sake of demonstrating the protection techniques, the object code will
also be stored on the disc it formats. The program assembles the object
code to run at PAGE+&100. This is so that the programs which will be used
to store the object code on a protected disc and to read that code back
from the disc can be located at PAGE. These saving and loading programs
are very short and &100 bytes is more than enough room for them. When you
design your own protection system you may need more space for your saving
and loading programs.

The formatting program introduced in module 3 created an empty catalogue
which only contained the number of sectors available on the disc. The
catalogue created by the program above actually contains a disc title,
some file information and the start up option. The disc title is the ASCII
character &15 which disables the VDU and so prevents the disc being
catalogued. The dummy file $.!BOOT is entered into the catalogue and it is
specified as &800 bytes long starting in sector &02. This means that the
dummy !BOOT file uses all the available space on track &00. The number of
available sectors on the disc is specified as &0A and so the catalogue and
the dummy !BOOT file use all the available space on the disc. The start up
option is equivalent to *OPT 4,2 so that the !BOOT file will be *RUN on
Shift+Break. This formatting program produces the sector map shown in
figure 1. You can see that it has not been optimised for speed and you may
like to modify using the logical sector offsets described in module 3.


                    DFS format physical sector numbers
                 
                | 00  01  02  03  04  05  06  07  08  09
             ---+---------------------------------------
          T  00 | 00  01  02  03  04  05  06  07  08  09
          r  01 |   01      02      03      04      05    Logical
          a  02 |   01      02      03      04      05    sector
          c  03 |   01      02      03      04      05    numbers
          k  04 |   01      02      03      04      05
          s  05 |   01 ...


            Figure 1. The distribution of logical sectors
            ---------------------------------------------


When the disc has been formatted you can use the program IDSDUMP (from
module 0) to check the ID fields and the program VERIFY (also from module
0) to verify the format.

The object code program FORM5, which is used to format the disc, can be
stored on the newly formatted disc using the object code generated by the
program ENCODE. Run ENCODE and choose a suitable filename for the object
code it produces when prompted. For the sake of this demonstration I will
assume that you will call it SAVE5. The object code program SAVE5 will
save the &400 byte program FORM5 onto the first two logical sectors of
track &01, storing the data as deleted data.

*LOAD FORM5 and then type *RUN SAVE5. Swap the DFS disc for the newly
formatted 5 sector per track disc and press the spacebar. The object code
program FORM5 will be stored on the disc. You can use the program VERIFY
to make sure that the data is sucessfully stored as deleted data.


   10 REM: ENCODE
   20 DIM mcode &100
   25 page=PAGE
   30 osrdch=&FFE0
   40 oswrch=&FFEE
   50 osword=&FFF1
   60 FORpass=4 TO 6 STEP 2
   70 O%=mcode
   80 P%=page
   90 [       OPT pass
  100 .firstbyte
  110         EQUW &FF0D    \ NEW the BASIC program
  120 .start
  130         LDX #&00
  140 .loop
  150         LDA message,X
  160         BEQ end
  170         JSR oswrch
  180         INX
  190         BNE loop
  200 .end
  210         JSR osrdch
  220         BCC save
  230         BRK
  240         BRK
  250         EQUS "Escape"
  260         BRK
  270 .save
  280         LDA #&7F
  290         LDX #block MOD 256
  300         LDY #block DIV 256
  310         JSR osword    \ write deleted data
  320         LDA result    \ load result byte
  330         AND #&1E      \ isolate error code
  340         BNE error
  350         BRK
  360         BRK
  370         EQUS "Write OK"
  380 .error
  390         BRK
  400         BRK
  410         EQUS "Write failed"
  420         BRK
  430 .block
  440         EQUB &FF      \ current drive
  450         EQUD page+&100 \ start at PAGE+&100
  460         EQUB &03      \ 3 parameters
  470         EQUB &4F      \ write deleted multi-sector
  480         EQUB &01      \ logical track &01
  490         EQUB &00      \ start logical sector &00
  500         EQUB &42      \ 2 sectors of 512 bytes
  510 .result
  520         EQUB &00      \ result byte
  530 .message
  540         EQUS "Press Space to save data on current disc"
  550         BRK
  560 .lastbyte
  570 ]
  580 NEXT
  590 INPUT'"Save filename = "filename$
  600 IF filename$ = "" THEN END
  610 *OPT1,2
  620 OSCLI("SAVE "+filename$+" "+STR$~(mcode)+"+"+STR$~(las
      tbyte-firstbyte)+" "+STR$~(start)+" "+STR$~(firstbyte))
  630 *OPT1,0
  640 END


The data stored on the disc using SAVE5 cannot be read back off the disc
using any of the DFS star commands. The disc has been formatted so that a
!BOOT file will be *RUN on Shift+Break and so the dummy !BOOT file entered
into the catalogue by the formatting program needs to be replaced with a
real !BOOT file which will load and run the program stored on track &01.

The program DECODE will produce an appropriate machine code !BOOT file
which simply reverses the Write Deleted Data operation which put the data
onto the disc. When the deleted data have been reloaded into memory the
command CALL (PAGE+&102) <Return> is inserted into the keyboard buffer,
and BASIC is entered using Osbyte &8E. The VDU is disabled before
inserting the data into the keyboard buffer (lines 460-470) and re-enabled
before the command is executed (line 610). This hides what you are doing
from the disc user. Any command, or series of commands, can be executed in
this way so that BASIC programs as well as machine code programs can be
stored on, and run from, the copy-protected disc.

The optional code in lines 140 to 230 of DECODE can be used to further
protect your software but you should start to think of your own ideas to
incorporate with these techniques. Disc copy-protection is only useful if
it is unique and very difficult to break. These programs are neither but
they are a good introduction to the necessary techniques and the discs
they produce cannot be duplicated with the *BACKUP command.


   10 REM: DECODE
   20 page=PAGE
   30 DIM mcode &100
   40 osasci=&FFE3
   50 osword=&FFF1
   60 osbyte=&FFF4
   70 FORpass=4 TO 6 STEP 2
   80 O%=mcode
   90 P%=page
  100 [       OPT pass
  110 .firstbyte
  120         EQUW &FF0D    \ NEW the BASIC program
  130 .start
  140                       \ LDA #&C8 \ write Break effect
  150                       \ LDX #&02 \ clear memory on Break
  160                       \ LDY #&00
  170                       \ JSR osbyte
  180                       \ LDA #&4C \ JMP opcode
  190                       \ LDX #&87 \ JMP &287 gives an
  200                       \ LDY #&02 \ endless loop on Break
  210                       \ STA &287
  220                       \ STX &288
  230                       \ STY &289
  240         LDA #&7F
  250         LDX #block MOD 256
  260         LDY #block DIV 256
  270         JSR osword    \ read deleted data
  280         LDA result    \ load result byte
  290         AND #&1E      \ isolate error code
  300         BNE error
  310         LDA #&FF      \ initialise offset
  320         PHA           \ save offset
  330 .pull
  340         PLA
  350         TAX
  360         INX           \ increment offset
  370         TXA
  380         PHA           \ store current offset
  390         LDY keyboard,X \ load byte for keyboard buffer
  400         BEQ continue  \ branch if finished
  410         LDX #0
  420         LDA #&8A
  430         JSR osbyte    \ put byte into keyboard buffer
  440         JMP pull
  450 .continue
  460         LDA #&15
  470         JSR osasci    \ disable VDU
  480         LDA #&BB
  490         LDX #0
  500         LDY #&FF
  510         JSR osbyte    \ find BASIC
  520         LDA #&8E
  530         JMP osbyte    \ select BASIC no return
  540 .error
  550         BRK
  560         BRK
  570         EQUS "Disc read error"
  580         BRK
  590 .keyboard
  600         EQUS "CALL &"+STR$~(page+&102)
  610         EQUB &06      \ enable VDU
  620         EQUB &0D
  630         BRK
  640 .block
  650         EQUB &FF      \ current drive
  660         EQUD page+&100 \ start at PAGE+&100
  670         EQUB &03      \ 3 parameters
  680         EQUB &57      \ read deleted multi-sector
  690         EQUB &01      \ logical track &01
  700         EQUB &00      \ start logical sector 0
  710         EQUB &42      \ 2 sectors of 512 bytes
  720 .result
  730         EQUB &00      \ result byte
  740 .lastbyte
  750 ]
  760 NEXT
  770 PRINT'"Press Space to save !BOOT file"
  780 REPEAT
  790 UNTIL GET=32
  800 *OPT1,2
  810 OSCLI("SAVE $.!BOOT "+STR$~(mcode)+"+"+STR$~(lastbyte-
      firstbyte)+" "+STR$~(start)+" "+STR$~(firstbyte))
  820 *OPT1,0
00000000  54 68 65 20 41 63 6f 72  6e 20 44 46 53 20 4f 73  |The Acorn DFS Os|
00000010  77 6f 72 64 20 63 6f 6d  6d 61 6e 64 73 20 20 2d  |word commands  -|
00000020  20 20 62 79 20 20 2d 20  20 47 6f 72 64 6f 6e 20  |  by  -  Gordon |
00000030  48 6f 72 73 69 6e 67 74  6f 6e 0d 2d 2d 2d 2d 2d  |Horsington.-----|
00000040  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000070  2d 2d 2d 2d 2d 0d 0d 4d  6f 64 75 6c 65 20 36 2e  |-----..Module 6.|
00000080  20 43 72 65 61 74 69 6e  67 20 63 6f 70 79 2d 70  | Creating copy-p|
00000090  72 6f 74 65 63 74 65 64  20 73 69 6e 67 6c 65 20  |rotected single |
000000a0  64 65 6e 73 69 74 79 20  64 69 73 63 73 0d 2d 2d  |density discs.--|
000000b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000000e0  2d 2d 2d 2d 0d 0d 20 20  20 20 20 20 2b 2d 2d 2d  |----..      +---|
000000f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000120  2d 2d 2d 2d 2d 2d 2d 2b  0d 20 20 20 20 20 20 7c  |-------+.      ||
00000130  20 41 6c 6c 20 74 68 65  20 44 46 53 20 6d 6f 64  | All the DFS mod|
00000140  75 6c 65 73 20 69 6e 20  20 74 68 69 73 20 20 73  |ules in  this  s|
00000150  65 72 69 65 73 20 20 75  73 65 20 70 72 6f 67 72  |eries  use progr|
00000160  61 6d 73 20 77 68 69 63  68 20 7c 0d 20 20 20 20  |ams which |.    |
00000170  20 20 7c 20 65 78 70 65  72 69 6d 65 6e 74 20 20  |  | experiment  |
00000180  77 69 74 68 20 74 68 65  20 66 6f 72 6d 61 74 20  |with the format |
00000190  61 6e 64 20 63 6f 6e 74  65 6e 74 73 20 6f 66 20  |and contents of |
000001a0  64 69 73 63 73 2e 20 54  68 65 73 65 20 7c 0d 20  |discs. These |. |
000001b0  20 20 20 20 20 7c 20 65  78 70 65 72 69 6d 65 6e  |     | experimen|
000001c0  74 73 20 6d 61 79 20 20  68 61 76 65 20 64 69 73  |ts may  have dis|
000001d0  61 73 74 65 72 6f 75 73  20 65 66 66 65 63 74 73  |asterous effects|
000001e0  20 69 66 20 79 6f 75 20  75 73 65 20 61 6e 79 20  | if you use any |
000001f0  7c 0d 20 20 20 20 20 20  7c 20 6f 66 20 74 68 65  ||.      | of the|
00000200  20 70 72 6f 67 72 61 6d  73 20 20 6f 6e 20 20 64  | programs  on  d|
00000210  69 73 63 73 20 20 77 68  69 63 68 20 73 74 6f 72  |iscs  which stor|
00000220  65 20 70 72 6f 67 72 61  6d 73 20 6f 72 20 64 61  |e programs or da|
00000230  74 61 20 7c 0d 20 20 20  20 20 20 7c 20 77 68 69  |ta |.      | whi|
00000240  63 68 20 79 6f 75 20 63  61 6e 6e 6f 74 20 61 66  |ch you cannot af|
00000250  66 6f 72 64 20 74 6f 20  6c 6f 73 65 2e 20 20 59  |ford to lose.  Y|
00000260  6f 75 20 20 73 68 6f 75  6c 64 20 20 66 69 72 73  |ou  should  firs|
00000270  74 20 74 72 79 20 7c 0d  20 20 20 20 20 20 7c 20  |t try |.      | |
00000280  6f 75 74 20 20 74 68 65  20 20 70 72 6f 67 72 61  |out  the  progra|
00000290  6d 73 20 20 75 73 69 6e  67 20 20 64 69 73 63 73  |ms  using  discs|
000002a0  20 20 74 68 61 74 20 20  68 61 76 65 20 65 69 74  |  that  have eit|
000002b0  68 65 72 20 62 65 65 6e  20 7c 0d 20 20 20 20 20  |her been |.     |
000002c0  20 7c 20 64 75 70 6c 69  63 61 74 65 64 20 6f 72  | | duplicated or|
000002d0  2c 20 62 65 74 74 65 72  20 73 74 69 6c 6c 2c 20  |, better still, |
000002e0  68 61 76 65 20 6e 6f 74  20 62 65 65 6e 20 75 73  |have not been us|
000002f0  65 64 20 61 74 20 61 6c  6c 2e 20 20 7c 0d 20 20  |ed at all.  |.  |
00000300  20 20 20 20 2b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |    +-----------|
00000310  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000330  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2b  |---------------+|
00000340  0d 0d 0d 49 6e 20 74 68  69 73 20 6d 6f 64 75 6c  |...In this modul|
00000350  65 20 49 20 77 69 6c 6c  20 64 65 73 63 72 69 62  |e I will describ|
00000360  65 20 69 6e 20 64 65 74  61 69 6c 20 6f 6e 65 20  |e in detail one |
00000370  6d 65 74 68 6f 64 20 6f  66 20 70 72 6f 64 75 63  |method of produc|
00000380  69 6e 67 20 63 6f 70 79  2d 0d 70 72 6f 74 65 63  |ing copy-.protec|
00000390  74 65 64 20 73 69 6e 67  6c 65 20 64 65 6e 73 69  |ted single densi|
000003a0  74 79 20 64 69 73 63 73  2e 20 54 68 69 73 20 74  |ty discs. This t|
000003b0  79 70 65 20 6f 66 20 64  69 73 63 20 69 73 20 64  |ype of disc is d|
000003c0  65 73 69 67 6e 65 64 20  74 6f 20 70 72 65 76 65  |esigned to preve|
000003d0  6e 74 0d 6f 74 68 65 72  20 70 65 6f 70 6c 65 20  |nt.other people |
000003e0  73 65 65 69 6e 67 20 68  6f 77 20 79 6f 75 72 20  |seeing how your |
000003f0  70 72 6f 67 72 61 6d 73  20 77 6f 72 6b 20 61 6e  |programs work an|
00000400  64 20 74 6f 20 73 74 6f  70 20 74 68 65 6d 20 64  |d to stop them d|
00000410  75 70 6c 69 63 61 74 69  6e 67 0d 74 68 65 20 64  |uplicating.the d|
00000420  69 73 63 2e 20 4d 65 65  74 69 6e 67 20 74 68 65  |isc. Meeting the|
00000430  20 66 69 72 73 74 20 6f  62 6a 65 63 74 69 76 65  | first objective|
00000440  20 69 73 20 72 65 6c 61  74 69 76 65 6c 79 20 65  | is relatively e|
00000450  61 73 79 2e 20 4d 65 65  74 69 6e 67 20 74 68 65  |asy. Meeting the|
00000460  0d 73 65 63 6f 6e 64 20  6f 62 6a 65 63 74 69 76  |.second objectiv|
00000470  65 20 69 73 20 76 69 72  74 75 61 6c 6c 79 20 69  |e is virtually i|
00000480  6d 70 6f 73 73 69 62 6c  65 2e 20 49 74 20 69 73  |mpossible. It is|
00000490  20 65 61 73 79 20 74 6f  20 70 72 65 76 65 6e 74  | easy to prevent|
000004a0  20 61 6d 61 74 65 75 72  0d 70 69 72 61 63 79 20  | amateur.piracy |
000004b0  75 73 69 6e 67 20 64 75  70 6c 69 63 61 74 69 6e  |using duplicatin|
000004c0  67 20 70 72 6f 67 72 61  6d 73 20 62 75 74 20 79  |g programs but y|
000004d0  6f 75 20 77 69 6c 6c 20  6e 65 76 65 72 20 62 65  |ou will never be|
000004e0  20 61 62 6c 65 20 74 6f  20 73 74 6f 70 20 61 0d  | able to stop a.|
000004f0  64 65 74 65 72 6d 69 6e  65 64 20 68 61 63 6b 65  |determined hacke|
00000500  72 20 75 6e 64 6f 69 6e  67 20 61 6c 6c 20 79 6f  |r undoing all yo|
00000510  75 72 20 65 66 66 6f 72  74 73 20 74 6f 20 70 72  |ur efforts to pr|
00000520  65 76 65 6e 74 20 64 75  70 6c 69 63 61 74 69 6f  |event duplicatio|
00000530  6e 2e 20 49 20 68 61 76  65 0d 6e 6f 74 20 79 65  |n. I have.not ye|
00000540  74 20 66 6f 75 6e 64 20  61 20 63 6f 6d 6d 65 72  |t found a commer|
00000550  63 69 61 6c 6c 79 20 70  72 6f 64 75 63 65 64 20  |cially produced |
00000560  63 6f 70 79 2d 70 72 6f  74 65 63 74 65 64 20 64  |copy-protected d|
00000570  69 73 63 20 66 6f 72 20  74 68 65 20 42 42 43 0d  |isc for the BBC.|
00000580  72 61 6e 67 65 20 6f 66  20 63 6f 6d 70 75 74 65  |range of compute|
00000590  72 73 20 77 68 69 63 68  20 63 61 6e 20 6e 6f 74  |rs which can not|
000005a0  20 68 61 76 65 20 61 6c  6c 20 74 68 65 20 70 72  | have all the pr|
000005b0  6f 74 65 63 74 69 6f 6e  20 72 65 6d 6f 76 65 64  |otection removed|
000005c0  20 73 6f 20 74 68 61 74  0d 74 68 65 20 64 69 73  | so that.the dis|
000005d0  63 20 63 61 6e 20 62 65  20 64 75 70 6c 69 63 61  |c can be duplica|
000005e0  74 65 64 20 77 69 74 68  20 74 68 65 20 2a 42 41  |ted with the *BA|
000005f0  43 4b 55 50 20 63 6f 6d  6d 61 6e 64 2e 0d 0d 49  |CKUP command...I|
00000600  66 20 79 6f 75 20 63 68  6f 6f 73 65 20 74 6f 20  |f you choose to |
00000610  63 6f 70 79 2d 70 72 6f  74 65 63 74 20 79 6f 75  |copy-protect you|
00000620  72 20 64 69 73 63 73 20  79 6f 75 20 77 69 6c 6c  |r discs you will|
00000630  20 61 74 20 6c 65 61 73  74 20 69 6e 64 69 63 61  | at least indica|
00000640  74 65 20 74 6f 20 74 68  65 0d 75 73 65 72 73 20  |te to the.users |
00000650  6f 66 20 79 6f 75 72 20  73 6f 66 74 77 61 72 65  |of your software|
00000660  20 74 68 61 74 20 79 6f  75 20 61 72 65 20 75 6e  | that you are un|
00000670  77 69 6c 6c 69 6e 67 20  74 6f 20 68 61 76 65 20  |willing to have |
00000680  74 68 65 20 64 69 73 63  20 64 75 70 6c 69 63 61  |the disc duplica|
00000690  74 65 64 2e 0d 54 6f 20  73 74 61 6e 64 20 74 68  |ted..To stand th|
000006a0  65 20 62 65 73 74 20 63  68 61 6e 63 65 20 6f 66  |e best chance of|
000006b0  20 64 65 66 65 61 74 69  6e 67 20 61 20 68 61 63  | defeating a hac|
000006c0  6b 65 72 20 79 6f 75 20  73 68 6f 75 6c 64 20 75  |ker you should u|
000006d0  73 65 20 74 68 65 20 6d  65 74 68 6f 64 0d 64 65  |se the method.de|
000006e0  73 63 72 69 62 65 64 20  69 6e 20 74 68 69 73 20  |scribed in this |
000006f0  6d 6f 64 75 6c 65 20 61  73 20 61 20 73 74 61 72  |module as a star|
00000700  74 69 6e 67 20 70 6f 69  6e 74 20 66 6f 72 20 64  |ting point for d|
00000710  65 76 65 6c 6f 70 69 6e  67 20 79 6f 75 72 20 6f  |eveloping your o|
00000720  77 6e 20 69 64 65 61 73  0d 61 62 6f 75 74 20 70  |wn ideas.about p|
00000730  72 6f 74 65 63 74 69 6f  6e 2e 20 52 65 6d 65 6d  |rotection. Remem|
00000740  62 65 72 20 74 68 61 74  20 65 76 65 72 79 6f 6e  |ber that everyon|
00000750  65 20 72 65 61 64 69 6e  67 20 74 68 69 73 20 6d  |e reading this m|
00000760  6f 64 75 6c 65 20 77 69  6c 6c 20 6b 6e 6f 77 20  |odule will know |
00000770  68 6f 77 0d 74 6f 20 75  6e 64 6f 20 74 68 65 20  |how.to undo the |
00000780  70 72 6f 74 65 63 74 69  6f 6e 20 62 79 20 6a 75  |protection by ju|
00000790  73 74 20 72 65 76 65 72  73 69 6e 67 20 74 68 65  |st reversing the|
000007a0  20 73 74 65 70 73 20 69  6e 20 74 68 65 20 70 72  | steps in the pr|
000007b0  6f 63 65 64 75 72 65 2e  20 59 6f 75 0d 73 68 6f  |ocedure. You.sho|
000007c0  75 6c 64 20 61 74 20 6c  65 61 73 74 20 61 69 6d  |uld at least aim|
000007d0  20 74 6f 20 70 72 6f 64  75 63 65 20 61 20 64 69  | to produce a di|
000007e0  73 63 20 77 68 69 63 68  20 63 61 6e 6e 6f 74 20  |sc which cannot |
000007f0  62 65 20 64 75 70 6c 69  63 61 74 65 64 20 62 79  |be duplicated by|
00000800  20 65 69 74 68 65 72 0d  6f 66 20 74 68 65 20 74  | either.of the t|
00000810  77 6f 20 64 69 73 63 20  64 75 70 6c 69 63 61 74  |wo disc duplicat|
00000820  6f 72 73 20 64 65 73 63  72 69 62 65 64 20 69 6e  |ors described in|
00000830  20 74 68 65 20 6e 65 78  74 20 6d 6f 64 75 6c 65  | the next module|
00000840  2e 20 54 68 69 73 20 77  69 6c 6c 20 6e 6f 74 20  |. This will not |
00000850  62 65 0d 65 61 73 79 20  62 75 74 20 61 6c 6c 20  |be.easy but all |
00000860  74 68 65 20 69 6e 66 6f  72 6d 61 74 69 6f 6e 20  |the information |
00000870  79 6f 75 20 6e 65 65 64  20 74 6f 20 64 6f 20 69  |you need to do i|
00000880  74 20 68 61 73 20 62 65  65 6e 20 6f 72 20 77 69  |t has been or wi|
00000890  6c 6c 20 62 65 0d 70 72  65 73 65 6e 74 65 64 20  |ll be.presented |
000008a0  69 6e 20 74 68 69 73 20  73 65 72 69 65 73 2e 20  |in this series. |
000008b0  59 6f 75 20 6d 69 67 68  74 20 6c 69 6b 65 20 74  |You might like t|
000008c0  6f 20 63 6f 6e 73 69 64  65 72 20 75 73 69 6e 67  |o consider using|
000008d0  20 42 61 64 20 54 72 61  63 6b 73 2c 0d 55 6e 75  | Bad Tracks,.Unu|
000008e0  73 75 61 6c 20 6c 6f 67  69 63 61 6c 20 73 65 63  |sual logical sec|
000008f0  74 6f 72 20 6e 75 6d 62  65 72 73 20 61 6e 64 20  |tor numbers and |
00000900  6c 6f 67 69 63 61 6c 20  74 72 61 63 6b 20 6e 75  |logical track nu|
00000910  6d 62 65 72 73 20 69 6e  20 75 6e 65 78 70 65 63  |mbers in unexpec|
00000920  74 65 64 0d 63 6f 6d 62  69 6e 61 74 69 6f 6e 73  |ted.combinations|
00000930  2c 20 65 6e 63 72 79 70  74 65 64 20 6d 61 63 68  |, encrypted mach|
00000940  69 6e 65 20 63 6f 64 65  20 70 72 6f 67 72 61 6d  |ine code program|
00000950  73 20 61 6e 64 20 6d 75  6c 74 69 70 6c 65 20 66  |s and multiple f|
00000960  69 6c 65 73 20 77 68 69  63 68 20 75 73 65 0d 75  |iles which use.u|
00000970  6e 75 73 75 61 6c 20 6d  65 74 68 6f 64 73 20 6f  |nusual methods o|
00000980  66 20 77 72 69 74 69 6e  67 20 74 6f 20 61 6e 64  |f writing to and|
00000990  20 72 65 61 64 69 6e 67  20 66 72 6f 6d 20 74 68  | reading from th|
000009a0  65 20 64 69 73 63 2e 20  57 68 61 74 20 79 6f 75  |e disc. What you|
000009b0  20 64 6f 20 69 73 20 75  70 0d 74 6f 20 79 6f 75  | do is up.to you|
000009c0  20 62 75 74 20 79 6f 75  20 6d 75 73 74 20 74 72  | but you must tr|
000009d0  79 20 74 6f 20 74 68 69  6e 6b 20 6c 69 6b 65 20  |y to think like |
000009e0  61 20 68 61 63 6b 65 72  20 69 66 20 79 6f 75 20  |a hacker if you |
000009f0  77 61 6e 74 20 74 6f 20  70 72 65 76 65 6e 74 20  |want to prevent |
00000a00  79 6f 75 72 0d 73 6f 66  74 77 61 72 65 20 62 65  |your.software be|
00000a10  69 6e 67 20 68 61 63 6b  65 64 2e 0d 0d 54 68 65  |ing hacked...The|
00000a20  20 6d 65 74 68 6f 64 20  75 73 65 64 20 74 6f 20  | method used to |
00000a30  69 6e 74 72 6f 64 75 63  65 20 63 6f 70 79 2d 70  |introduce copy-p|
00000a40  72 6f 74 65 63 74 69 6f  6e 20 77 69 6c 6c 20 75  |rotection will u|
00000a50  73 65 20 61 20 73 69 6e  67 6c 65 20 64 65 6e 73  |se a single dens|
00000a60  69 74 79 0d 64 69 73 63  20 66 6f 72 6d 61 74 74  |ity.disc formatt|
00000a70  65 64 20 77 69 74 68 20  35 20 73 65 63 74 6f 72  |ed with 5 sector|
00000a80  73 20 70 65 72 20 74 72  61 63 6b 20 69 6e 73 74  |s per track inst|
00000a90  65 61 64 20 6f 66 20 74  68 65 20 75 73 75 61 6c  |ead of the usual|
00000aa0  20 31 30 20 73 65 63 74  6f 72 73 0d 70 65 72 20  | 10 sectors.per |
00000ab0  74 72 61 63 6b 2e 20 54  68 65 20 64 61 74 61 20  |track. The data |
00000ac0  77 69 6c 6c 20 62 65 20  73 74 6f 72 65 64 20 6f  |will be stored o|
00000ad0  6e 20 74 68 65 20 64 69  73 63 20 75 73 69 6e 67  |n the disc using|
00000ae0  20 74 68 65 20 57 72 69  74 65 20 44 65 6c 65 74  | the Write Delet|
00000af0  65 64 0d 44 61 74 61 20  63 6f 6d 6d 61 6e 64 20  |ed.Data command |
00000b00  61 73 20 61 6e 20 65 78  74 72 61 20 70 72 6f 74  |as an extra prot|
00000b10  65 63 74 69 6f 6e 2e 0d  0d 41 20 64 69 73 63 20  |ection...A disc |
00000b20  63 61 6e 6e 6f 74 20 62  65 20 66 6f 72 6d 61 74  |cannot be format|
00000b30  74 65 64 20 77 69 74 68  20 35 20 73 65 63 74 6f  |ted with 5 secto|
00000b40  72 73 20 70 65 72 20 74  72 61 63 6b 20 75 73 69  |rs per track usi|
00000b50  6e 67 20 74 68 65 20 44  46 53 0d 66 6f 72 6d 61  |ng the DFS.forma|
00000b60  74 74 65 72 20 61 6e 64  20 73 6f 20 74 68 65 20  |tter and so the |
00000b70  66 69 72 73 74 20 73 74  65 70 20 69 6e 20 74 68  |first step in th|
00000b80  69 73 20 70 72 6f 63 65  64 75 72 65 20 77 69 6c  |is procedure wil|
00000b90  6c 20 62 65 20 74 6f 20  77 72 69 74 65 20 61 0d  |l be to write a.|
00000ba0  73 70 65 63 69 61 6c 20  64 69 73 63 20 66 6f 72  |special disc for|
00000bb0  6d 61 74 74 69 6e 67 20  70 72 6f 67 72 61 6d 2e  |matting program.|
00000bc0  20 54 68 65 20 70 72 6f  67 72 61 6d 20 53 45 43  | The program SEC|
00000bd0  54 4f 52 35 20 63 61 6e  20 62 65 20 75 73 65 64  |TOR5 can be used|
00000be0  20 74 6f 0d 70 72 6f 64  75 63 65 20 61 6e 20 6f  | to.produce an o|
00000bf0  62 6a 65 63 74 20 63 6f  64 65 20 66 69 6c 65 20  |bject code file |
00000c00  77 68 69 63 68 2c 20 69  6e 20 74 75 72 6e 2c 20  |which, in turn, |
00000c10  63 61 6e 20 62 65 20 75  73 65 64 20 74 6f 20 70  |can be used to p|
00000c20  72 6f 64 75 63 65 20 61  0d 73 69 6e 67 6c 65 20  |roduce a.single |
00000c30  64 65 6e 73 69 74 79 20  64 69 73 63 20 77 69 74  |density disc wit|
00000c40  68 20 61 20 73 74 61 6e  64 61 72 64 20 74 72 61  |h a standard tra|
00000c50  63 6b 20 26 30 30 20 61  6e 64 20 74 68 65 20 72  |ck &00 and the r|
00000c60  65 73 74 20 6f 66 20 74  68 65 20 64 69 73 63 0d  |est of the disc.|
00000c70  66 6f 72 6d 61 74 74 65  64 20 77 69 74 68 20 35  |formatted with 5|
00000c80  20 73 65 63 74 6f 72 73  20 6f 6e 20 65 76 65 72  | sectors on ever|
00000c90  79 20 74 72 61 63 6b 2e  20 45 61 63 68 20 6f 66  |y track. Each of|
00000ca0  20 74 68 65 20 6e 6f 6e  2d 73 74 61 6e 64 61 72  | the non-standar|
00000cb0  64 20 74 72 61 63 6b 73  0d 69 73 20 63 61 70 61  |d tracks.is capa|
00000cc0  62 6c 65 20 6f 66 20 73  74 6f 72 69 6e 67 20 32  |ble of storing 2|
00000cd0  2e 35 6b 20 6f 66 20 64  61 74 61 20 69 6e 20 35  |.5k of data in 5|
00000ce0  20 73 65 63 74 6f 72 73  2c 20 69 65 2e 20 35 31  | sectors, ie. 51|
00000cf0  32 20 62 79 74 65 73 20  70 65 72 20 73 65 63 74  |2 bytes per sect|
00000d00  6f 72 2e 0d 54 68 65 20  6f 62 6a 65 63 74 20 63  |or..The object c|
00000d10  6f 64 65 20 66 69 6c 65  20 70 72 6f 64 75 63 65  |ode file produce|
00000d20  64 20 62 79 20 53 45 43  54 4f 52 35 20 69 73 20  |d by SECTOR5 is |
00000d30  65 78 61 63 74 6c 79 20  31 6b 20 6c 6f 6e 67 20  |exactly 1k long |
00000d40  61 6e 64 20 63 61 6e 20  62 65 0d 73 74 6f 72 65  |and can be.store|
00000d50  64 20 69 6e 20 74 77 6f  20 6f 66 20 74 68 65 20  |d in two of the |
00000d60  35 31 32 20 62 79 74 65  20 73 65 63 74 6f 72 73  |512 byte sectors|
00000d70  2e 20 49 20 77 69 6c 6c  20 75 73 65 20 74 68 69  |. I will use thi|
00000d80  73 20 6f 62 6a 65 63 74  20 63 6f 64 65 20 66 69  |s object code fi|
00000d90  6c 65 20 61 73 0d 61 6e  20 65 78 61 6d 70 6c 65  |le as.an example|
00000da0  20 66 6f 72 20 70 72 6f  64 75 63 69 6e 67 20 74  | for producing t|
00000db0  68 65 20 72 65 71 75 69  72 65 64 20 63 6f 70 79  |he required copy|
00000dc0  2d 70 72 6f 74 65 63 74  65 64 20 64 69 73 63 2e  |-protected disc.|
00000dd0  0d 0d 52 75 6e 20 74 68  65 20 70 72 6f 67 72 61  |..Run the progra|
00000de0  6d 20 53 45 43 54 4f 52  35 20 61 6e 64 2c 20 77  |m SECTOR5 and, w|
00000df0  68 65 6e 20 70 72 6f 6d  70 74 65 64 2c 20 67 69  |hen prompted, gi|
00000e00  76 65 20 61 20 73 75 69  74 61 62 6c 65 20 66 69  |ve a suitable fi|
00000e10  6c 65 6e 61 6d 65 20 66  6f 72 0d 74 68 65 20 6f  |lename for.the o|
00000e20  62 6a 65 63 74 20 63 6f  64 65 20 66 69 6c 65 2e  |bject code file.|
00000e30  20 49 6e 20 74 68 65 20  72 65 73 74 20 6f 66 20  | In the rest of |
00000e40  74 68 69 73 20 6d 6f 64  75 6c 65 20 49 20 77 69  |this module I wi|
00000e50  6c 6c 20 72 65 66 65 72  20 74 6f 20 74 68 65 0d  |ll refer to the.|
00000e60  6f 62 6a 65 63 74 20 63  6f 64 65 20 66 69 6c 65  |object code file|
00000e70  20 70 72 6f 64 75 63 65  64 20 62 79 20 53 45 43  | produced by SEC|
00000e80  54 4f 52 35 20 61 73 20  46 4f 52 4d 35 2e 0d 0d  |TOR5 as FORM5...|
00000e90  0d 20 20 20 31 30 20 52  45 4d 3a 20 53 45 43 54  |.   10 REM: SECT|
00000ea0  4f 52 35 0d 20 20 20 32  30 20 44 49 4d 20 6d 63  |OR5.   20 DIM mc|
00000eb0  6f 64 65 20 26 35 30 30  0d 20 20 20 33 30 20 7a  |ode &500.   30 z|
00000ec0  65 72 6f 70 61 67 65 3d  26 37 30 0d 20 20 20 34  |eropage=&70.   4|
00000ed0  30 20 6f 73 77 72 63 68  3d 26 46 46 45 45 0d 20  |0 oswrch=&FFEE. |
00000ee0  20 20 35 30 20 6f 73 77  6f 72 64 3d 26 46 46 46  |  50 osword=&FFF|
00000ef0  31 0d 20 20 20 36 30 20  6f 73 62 79 74 65 3d 26  |1.   60 osbyte=&|
00000f00  46 46 46 34 0d 20 20 20  37 30 20 6f 73 6e 65 77  |FFF4.   70 osnew|
00000f10  6c 3d 26 46 46 45 37 0d  20 20 20 38 30 20 6f 73  |l=&FFE7.   80 os|
00000f20  77 72 63 68 3d 26 46 46  45 45 0d 20 20 20 39 30  |wrch=&FFEE.   90|
00000f30  20 6f 73 72 64 63 68 3d  26 46 46 45 30 0d 20 20  | osrdch=&FFE0.  |
00000f40  31 30 30 20 6f 73 61 73  63 69 3d 26 46 46 45 33  |100 osasci=&FFE3|
00000f50  0d 20 20 31 31 30 20 46  4f 52 70 61 73 73 3d 34  |.  110 FORpass=4|
00000f60  20 54 4f 20 36 20 53 54  45 50 20 32 0d 20 20 31  | TO 6 STEP 2.  1|
00000f70  32 30 20 4f 25 3d 6d 63  6f 64 65 0d 20 20 31 33  |20 O%=mcode.  13|
00000f80  30 20 50 25 3d 50 41 47  45 2b 26 31 30 30 0d 20  |0 P%=PAGE+&100. |
00000f90  20 31 34 30 20 5b 20 20  20 20 20 20 20 4f 50 54  | 140 [       OPT|
00000fa0  20 70 61 73 73 0d 20 20  31 35 30 20 2e 66 69 72  | pass.  150 .fir|
00000fb0  73 74 62 79 74 65 0d 20  20 31 36 30 20 20 20 20  |stbyte.  160    |
00000fc0  20 20 20 20 20 45 51 55  57 20 26 46 46 30 44 20  |     EQUW &FF0D |
00000fd0  20 20 20 5c 20 4e 45 57  20 74 68 65 20 42 41 53  |   \ NEW the BAS|
00000fe0  49 43 20 70 72 6f 67 72  61 6d 0d 20 20 31 37 30  |IC program.  170|
00000ff0  20 2e 73 74 61 72 74 0d  20 20 31 38 30 20 20 20  | .start.  180   |
00001000  20 20 20 20 20 20 4c 44  41 20 23 26 30 46 0d 20  |      LDA #&0F. |
00001010  20 31 39 30 20 20 20 20  20 20 20 20 20 4a 53 52  | 190         JSR|
00001020  20 6f 73 61 73 63 69 20  20 20 20 5c 20 73 63 72  | osasci    \ scr|
00001030  6f 6c 6c 20 6d 6f 64 65  0d 20 20 32 30 30 20 20  |oll mode.  200  |
00001040  20 20 20 20 20 20 20 4c  44 58 20 23 74 69 74 6c  |       LDX #titl|
00001050  65 20 4d 4f 44 20 32 35  36 0d 20 20 32 31 30 20  |e MOD 256.  210 |
00001060  20 20 20 20 20 20 20 20  4c 44 59 20 23 74 69 74  |        LDY #tit|
00001070  6c 65 20 44 49 56 20 32  35 36 0d 20 20 32 32 30  |le DIV 256.  220|
00001080  20 20 20 20 20 20 20 20  20 4a 53 52 20 70 72 69  |         JSR pri|
00001090  6e 74 20 20 20 20 20 5c  20 70 72 69 6e 74 20 74  |nt     \ print t|
000010a0  69 74 6c 65 0d 20 20 32  33 30 20 2e 67 65 74 64  |itle.  230 .getd|
000010b0  61 74 61 0d 20 20 32 34  30 20 20 20 20 20 20 20  |ata.  240       |
000010c0  20 20 4c 44 58 20 23 64  72 69 76 65 6e 75 6d 20  |  LDX #drivenum |
000010d0  4d 4f 44 20 32 35 36 0d  20 20 32 35 30 20 20 20  |MOD 256.  250   |
000010e0  20 20 20 20 20 20 4c 44  59 20 23 64 72 69 76 65  |      LDY #drive|
000010f0  6e 75 6d 20 44 49 56 20  32 35 36 0d 20 20 32 36  |num DIV 256.  26|
00001100  30 20 20 20 20 20 20 20  20 20 4a 53 52 20 70 72  |0         JSR pr|
00001110  69 6e 74 20 20 20 20 20  5c 20 77 68 69 63 68 20  |int     \ which |
00001120  64 72 69 76 65 3f 0d 20  20 32 37 30 20 2e 77 68  |drive?.  270 .wh|
00001130  69 63 68 64 72 69 76 65  0d 20 20 32 38 30 20 20  |ichdrive.  280  |
00001140  20 20 20 20 20 20 20 4a  53 52 20 6f 73 72 64 63  |       JSR osrdc|
00001150  68 0d 20 20 32 39 30 20  20 20 20 20 20 20 20 20  |h.  290         |
00001160  42 43 53 20 65 73 63 61  70 65 0d 20 20 33 30 30  |BCS escape.  300|
00001170  20 20 20 20 20 20 20 20  20 53 45 43 0d 20 20 33  |         SEC.  3|
00001180  31 30 20 20 20 20 20 20  20 20 20 53 42 43 20 23  |10         SBC #|
00001190  41 53 43 28 22 30 22 29  0d 20 20 33 32 30 20 20  |ASC("0").  320  |
000011a0  20 20 20 20 20 20 20 42  4d 49 20 77 68 69 63 68  |       BMI which|
000011b0  64 72 69 76 65 20 5c 20  64 72 69 76 65 20 30 2d  |drive \ drive 0-|
000011c0  33 0d 20 20 33 33 30 20  20 20 20 20 20 20 20 20  |3.  330         |
000011d0  43 4d 50 20 23 26 30 34  0d 20 20 33 34 30 20 20  |CMP #&04.  340  |
000011e0  20 20 20 20 20 20 20 42  43 53 20 77 68 69 63 68  |       BCS which|
000011f0  64 72 69 76 65 20 5c 20  64 72 69 76 65 20 30 2d  |drive \ drive 0-|
00001200  33 0d 20 20 33 35 30 20  20 20 20 20 20 20 20 20  |3.  350         |
00001210  53 54 41 20 62 6c 6f 63  6b 20 20 20 20 20 5c 20  |STA block     \ |
00001220  66 6f 72 6d 61 74 20 70  61 72 61 6d 65 74 65 72  |format parameter|
00001230  20 62 6c 6f 63 6b 0d 20  20 33 36 30 20 20 20 20  | block.  360    |
00001240  20 20 20 20 20 53 54 41  20 63 61 74 62 6c 6f 63  |     STA catbloc|
00001250  6b 20 20 5c 20 63 61 74  61 6c 6f 67 75 65 20 70  |k  \ catalogue p|
00001260  61 72 61 6d 65 74 65 72  20 62 6c 6f 63 6b 0d 20  |arameter block. |
00001270  20 33 37 30 20 20 20 20  20 20 20 20 20 41 44 43  | 370         ADC|
00001280  20 23 41 53 43 28 22 30  22 29 0d 20 20 33 38 30  | #ASC("0").  380|
00001290  20 20 20 20 20 20 20 20  20 4a 53 52 20 6f 73 61  |         JSR osa|
000012a0  73 63 69 20 20 20 20 5c  20 70 72 69 6e 74 20 30  |sci    \ print 0|
000012b0  2c 20 31 2c 20 32 20 6f  72 20 33 0d 20 20 33 39  |, 1, 2 or 3.  39|
000012c0  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 74  |0         LDX #t|
000012d0  72 61 63 6b 6e 75 6d 20  4d 4f 44 20 32 35 36 0d  |racknum MOD 256.|
000012e0  20 20 34 30 30 20 20 20  20 20 20 20 20 20 4c 44  |  400         LD|
000012f0  59 20 23 74 72 61 63 6b  6e 75 6d 20 44 49 56 20  |Y #tracknum DIV |
00001300  32 35 36 0d 20 20 34 31  30 20 20 20 20 20 20 20  |256.  410       |
00001310  20 20 4a 53 52 20 70 72  69 6e 74 20 20 20 20 20  |  JSR print     |
00001320  5c 20 34 30 20 6f 72 20  38 30 20 74 72 61 63 6b  |\ 40 or 80 track|
00001330  73 3f 0d 20 20 34 32 30  20 2e 77 68 69 63 68 74  |s?.  420 .whicht|
00001340  72 61 63 6b 0d 20 20 34  33 30 20 20 20 20 20 20  |rack.  430      |
00001350  20 20 20 4a 53 52 20 6f  73 72 64 63 68 0d 20 20  |   JSR osrdch.  |
00001360  34 34 30 20 20 20 20 20  20 20 20 20 42 43 53 20  |440         BCS |
00001370  65 73 63 61 70 65 0d 20  20 34 35 30 20 20 20 20  |escape.  450    |
00001380  20 20 20 20 20 4c 44 58  20 23 26 32 37 20 20 20  |     LDX #&27   |
00001390  20 20 20 5c 20 34 30 20  74 72 61 63 6b 73 0d 20  |   \ 40 tracks. |
000013a0  20 34 36 30 20 20 20 20  20 20 20 20 20 43 4d 50  | 460         CMP|
000013b0  20 23 41 53 43 28 22 34  22 29 0d 20 20 34 37 30  | #ASC("4").  470|
000013c0  20 20 20 20 20 20 20 20  20 42 45 51 20 63 6f 6e  |         BEQ con|
000013d0  74 69 6e 75 65 0d 20 20  34 38 30 20 20 20 20 20  |tinue.  480     |
000013e0  20 20 20 20 43 4d 50 20  23 41 53 43 28 22 38 22  |    CMP #ASC("8"|
000013f0  29 0d 20 20 34 39 30 20  20 20 20 20 20 20 20 20  |).  490         |
00001400  42 4e 45 20 77 68 69 63  68 74 72 61 63 6b 0d 20  |BNE whichtrack. |
00001410  20 35 30 30 20 20 20 20  20 20 20 20 20 4c 44 58  | 500         LDX|
00001420  20 23 26 34 46 20 20 20  20 20 20 5c 20 38 30 20  | #&4F      \ 80 |
00001430  74 72 61 63 6b 73 0d 20  20 35 31 30 20 2e 63 6f  |tracks.  510 .co|
00001440  6e 74 69 6e 75 65 0d 20  20 35 32 30 20 20 20 20  |ntinue.  520    |
00001450  20 20 20 20 20 53 54 58  20 66 69 6e 69 73 68 20  |     STX finish |
00001460  20 20 20 5c 20 73 74 6f  72 65 20 6e 75 6d 62 65  |   \ store numbe|
00001470  72 20 6f 66 20 74 72 61  63 6b 73 0d 20 20 35 33  |r of tracks.  53|
00001480  30 20 20 20 20 20 20 20  20 20 4a 53 52 20 6f 73  |0         JSR os|
00001490  61 73 63 69 20 20 20 20  5c 20 70 72 69 6e 74 20  |asci    \ print |
000014a0  22 38 22 20 6f 72 20 22  34 22 0d 20 20 35 34 30  |"8" or "4".  540|
000014b0  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 41 53  |         LDA #AS|
000014c0  43 28 22 30 22 29 0d 20  20 35 35 30 20 20 20 20  |C("0").  550    |
000014d0  20 20 20 20 20 4a 53 52  20 6f 73 61 73 63 69 20  |     JSR osasci |
000014e0  20 20 20 5c 20 70 72 69  6e 74 20 22 30 22 20 74  |   \ print "0" t|
000014f0  6f 20 6d 61 6b 65 20 22  34 30 22 20 6f 72 20 22  |o make "40" or "|
00001500  38 30 22 0d 20 20 35 36  30 20 20 20 20 20 20 20  |80".  560       |
00001510  20 20 4c 44 58 20 23 72  65 61 64 79 20 4d 4f 44  |  LDX #ready MOD|
00001520  20 32 35 36 0d 20 20 35  37 30 20 20 20 20 20 20  | 256.  570      |
00001530  20 20 20 4c 44 59 20 23  72 65 61 64 79 20 44 49  |   LDY #ready DI|
00001540  56 20 32 35 36 0d 20 20  35 38 30 20 20 20 20 20  |V 256.  580     |
00001550  20 20 20 20 4a 53 52 20  70 72 69 6e 74 20 20 20  |    JSR print   |
00001560  20 20 5c 20 72 65 61 64  79 20 74 6f 20 66 6f 72  |  \ ready to for|
00001570  6d 61 74 3f 0d 20 20 35  39 30 20 20 20 20 20 20  |mat?.  590      |
00001580  20 20 20 4a 53 52 20 6f  73 72 64 63 68 0d 20 20  |   JSR osrdch.  |
00001590  36 30 30 20 20 20 20 20  20 20 20 20 42 43 53 20  |600         BCS |
000015a0  65 73 63 61 70 65 0d 20  20 36 31 30 20 20 20 20  |escape.  610    |
000015b0  20 20 20 20 20 50 48 41  20 20 20 20 20 20 20 20  |     PHA        |
000015c0  20 20 20 5c 20 74 65 6d  70 20 73 74 6f 72 65 20  |   \ temp store |
000015d0  66 6f 72 20 61 6e 73 77  65 72 0d 20 20 36 32 30  |for answer.  620|
000015e0  20 20 20 20 20 20 20 20  20 4a 53 52 20 6f 73 61  |         JSR osa|
000015f0  73 63 69 20 20 20 20 5c  20 70 72 69 6e 74 20 61  |sci    \ print a|
00001600  6e 73 77 65 72 0d 20 20  36 33 30 20 20 20 20 20  |nswer.  630     |
00001610  20 20 20 20 4a 53 52 20  6f 73 6e 65 77 6c 0d 20  |    JSR osnewl. |
00001620  20 36 34 30 20 20 20 20  20 20 20 20 20 50 4c 41  | 640         PLA|
00001630  20 20 20 20 20 20 20 20  20 20 20 5c 20 70 75 6c  |           \ pul|
00001640  6c 20 61 6e 73 77 65 72  0d 20 20 36 35 30 20 20  |l answer.  650  |
00001650  20 20 20 20 20 20 20 41  4e 44 20 23 26 44 46 20  |       AND #&DF |
00001660  20 20 20 20 20 5c 20 75  70 70 65 72 20 63 61 73  |     \ upper cas|
00001670  65 0d 20 20 36 36 30 20  20 20 20 20 20 20 20 20  |e.  660         |
00001680  43 4d 50 20 23 41 53 43  28 22 59 22 29 0d 20 20  |CMP #ASC("Y").  |
00001690  36 37 30 20 20 20 20 20  20 20 20 20 42 4e 45 20  |670         BNE |
000016a0  67 65 74 64 61 74 61 0d  20 20 36 38 30 20 20 20  |getdata.  680   |
000016b0  20 20 20 20 20 20 4a 53  52 20 6f 73 6e 65 77 6c  |      JSR osnewl|
000016c0  0d 20 20 36 39 30 20 20  20 20 20 20 20 20 20 4c  |.  690         L|
000016d0  44 41 20 23 30 0d 20 20  37 30 30 20 20 20 20 20  |DA #0.  700     |
000016e0  20 20 20 20 53 54 41 20  74 72 61 63 6b 0d 20 20  |    STA track.  |
000016f0  37 31 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |710         LDA |
00001700  23 26 30 31 20 20 20 20  20 20 5c 20 64 61 74 61  |#&01      \ data|
00001710  20 73 69 7a 65 0d 20 20  37 32 30 20 20 20 20 20  | size.  720     |
00001720  20 20 20 20 4c 44 58 20  23 26 31 30 20 20 20 20  |    LDX #&10    |
00001730  20 20 5c 20 67 61 70 20  33 0d 20 20 37 33 30 20  |  \ gap 3.  730 |
00001740  20 20 20 20 20 20 20 20  4c 44 59 20 23 26 32 41  |        LDY #&2A|
00001750  20 20 20 20 20 20 5c 20  6e 75 6d 62 65 72 20 6f  |      \ number o|
00001760  66 20 73 65 63 74 6f 72  73 0d 20 20 37 34 30 20  |f sectors.  740 |
00001770  20 20 20 20 20 20 20 20  4a 53 52 20 73 65 74 75  |        JSR setu|
00001780  70 0d 20 20 37 35 30 20  20 20 20 20 20 20 20 20  |p.  750         |
00001790  4c 44 41 20 23 26 37 46  0d 20 20 37 36 30 20 20  |LDA #&7F.  760  |
000017a0  20 20 20 20 20 20 20 4c  44 58 20 23 62 6c 6f 63  |       LDX #bloc|
000017b0  6b 20 4d 4f 44 20 32 35  36 0d 20 20 37 37 30 20  |k MOD 256.  770 |
000017c0  20 20 20 20 20 20 20 20  4c 44 59 20 23 62 6c 6f  |        LDY #blo|
000017d0  63 6b 20 44 49 56 20 32  35 36 0d 20 20 37 38 30  |ck DIV 256.  780|
000017e0  20 20 20 20 20 20 20 20  20 4a 53 52 20 6f 73 77  |         JSR osw|
000017f0  6f 72 64 20 20 20 20 5c  20 66 6f 72 6d 61 74 20  |ord    \ format |
00001800  74 72 61 63 6b 20 30 20  74 65 6e 20 73 65 63 74  |track 0 ten sect|
00001810  6f 72 73 0d 20 20 37 39  30 20 20 20 20 20 20 20  |ors.  790       |
00001820  20 20 4c 44 41 20 72 65  73 75 6c 74 20 20 20 20  |  LDA result    |
00001830  5c 20 6c 6f 61 64 20 72  65 73 75 6c 74 20 62 79  |\ load result by|
00001840  74 65 0d 20 20 38 30 30  20 20 20 20 20 20 20 20  |te.  800        |
00001850  20 42 45 51 20 74 72 61  63 6b 7a 65 72 6f 20 5c  | BEQ trackzero \|
00001860  20 66 6f 72 6d 61 74 20  4f 4b 20 69 66 20 72 65  | format OK if re|
00001870  73 75 6c 74 20 3d 20 30  0d 20 20 38 31 30 20 2e  |sult = 0.  810 .|
00001880  65 72 72 6f 72 0d 20 20  38 32 30 20 20 20 20 20  |error.  820     |
00001890  20 20 20 20 42 52 4b 0d  20 20 38 33 30 20 20 20  |    BRK.  830   |
000018a0  20 20 20 20 20 20 42 52  4b 0d 20 20 38 34 30 20  |      BRK.  840 |
000018b0  20 20 20 20 20 20 20 20  45 51 55 53 20 22 46 6f  |        EQUS "Fo|
000018c0  72 6d 61 74 20 65 72 72  6f 72 22 0d 20 20 38 35  |rmat error".  85|
000018d0  30 20 20 20 20 20 20 20  20 20 42 52 4b 0d 20 20  |0         BRK.  |
000018e0  38 36 30 20 2e 65 73 63  61 70 65 0d 20 20 38 37  |860 .escape.  87|
000018f0  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 23 26  |0         LDA #&|
00001900  37 45 0d 20 20 38 38 30  20 20 20 20 20 20 20 20  |7E.  880        |
00001910  20 4a 53 52 20 6f 73 62  79 74 65 20 20 20 20 5c  | JSR osbyte    \|
00001920  20 61 63 6b 6e 6f 77 6c  65 64 67 65 20 45 73 63  | acknowledge Esc|
00001930  61 70 65 0d 20 20 38 39  30 20 20 20 20 20 20 20  |ape.  890       |
00001940  20 20 42 52 4b 0d 20 20  39 30 30 20 20 20 20 20  |  BRK.  900     |
00001950  20 20 20 20 42 52 4b 0d  20 20 39 31 30 20 20 20  |    BRK.  910   |
00001960  20 20 20 20 20 20 45 51  55 53 20 22 45 73 63 61  |      EQUS "Esca|
00001970  70 65 22 0d 20 20 39 32  30 20 20 20 20 20 20 20  |pe".  920       |
00001980  20 20 42 52 4b 0d 20 20  39 33 30 20 2e 74 72 61  |  BRK.  930 .tra|
00001990  63 6b 7a 65 72 6f 0d 20  20 39 34 30 20 20 20 20  |ckzero.  940    |
000019a0  20 20 20 20 20 4c 44 41  20 23 26 37 46 0d 20 20  |     LDA #&7F.  |
000019b0  39 35 30 20 20 20 20 20  20 20 20 20 4c 44 58 20  |950         LDX |
000019c0  23 63 61 74 62 6c 6f 63  6b 20 4d 4f 44 20 32 35  |#catblock MOD 25|
000019d0  36 0d 20 20 39 36 30 20  20 20 20 20 20 20 20 20  |6.  960         |
000019e0  4c 44 59 20 23 63 61 74  62 6c 6f 63 6b 20 44 49  |LDY #catblock DI|
000019f0  56 20 32 35 36 0d 20 20  39 37 30 20 20 20 20 20  |V 256.  970     |
00001a00  20 20 20 20 4a 53 52 20  6f 73 77 6f 72 64 20 20  |    JSR osword  |
00001a10  20 20 5c 20 73 74 6f 72  65 20 65 6d 70 74 79 20  |  \ store empty |
00001a20  63 61 74 61 6c 6f 67 75  65 0d 20 20 39 38 30 20  |catalogue.  980 |
00001a30  20 20 20 20 20 20 20 20  4c 44 41 20 63 61 74 72  |        LDA catr|
00001a40  65 73 75 6c 74 20 5c 20  63 68 65 63 6b 20 72 65  |esult \ check re|
00001a50  73 75 6c 74 20 62 79 74  65 0d 20 20 39 39 30 20  |sult byte.  990 |
00001a60  20 20 20 20 20 20 20 20  42 4e 45 20 65 72 72 6f  |        BNE erro|
00001a70  72 20 20 20 20 20 5c 20  71 75 69 74 20 69 66 20  |r     \ quit if |
00001a80  65 72 72 6f 72 0d 20 31  30 30 30 20 20 20 20 20  |error. 1000     |
00001a90  20 20 20 20 4a 53 52 20  70 72 69 6e 74 62 79 74  |    JSR printbyt|
00001aa0  65 20 5c 20 70 72 69 6e  74 20 74 72 61 63 6b 20  |e \ print track |
00001ab0  30 30 0d 20 31 30 31 30  20 2e 6c 6f 6f 70 0d 20  |00. 1010 .loop. |
00001ac0  31 30 32 30 20 20 20 20  20 20 20 20 20 4c 44 41  |1020         LDA|
00001ad0  20 26 46 46 20 20 20 20  20 20 20 5c 20 70 6f 6c  | &FF       \ pol|
00001ae0  6c 20 65 73 63 61 70 65  20 66 6c 61 67 0d 20 31  |l escape flag. 1|
00001af0  30 33 30 20 20 20 20 20  20 20 20 20 42 4d 49 20  |030         BMI |
00001b00  65 73 63 61 70 65 20 20  20 20 5c 20 62 69 74 20  |escape    \ bit |
00001b10  37 20 73 65 74 20 69 66  20 45 73 63 61 70 65 20  |7 set if Escape |
00001b20  70 72 65 73 73 65 64 0d  20 31 30 34 30 20 20 20  |pressed. 1040   |
00001b30  20 20 20 20 20 20 49 4e  43 20 74 72 61 63 6b 20  |      INC track |
00001b40  20 20 20 20 5c 20 69 6e  63 72 65 6d 65 6e 74 20  |    \ increment |
00001b50  74 72 61 63 6b 20 6e 75  6d 62 65 72 0d 20 31 30  |track number. 10|
00001b60  35 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 23  |50         LDA #|
00001b70  26 30 32 20 20 20 20 20  20 5c 20 64 61 74 61 20  |&02      \ data |
00001b80  73 69 7a 65 0d 20 31 30  36 30 20 20 20 20 20 20  |size. 1060      |
00001b90  20 20 20 4c 44 58 20 23  26 34 41 20 20 20 20 20  |   LDX #&4A     |
00001ba0  20 5c 20 67 61 70 20 33  0d 20 31 30 37 30 20 20  | \ gap 3. 1070  |
00001bb0  20 20 20 20 20 20 20 4c  44 59 20 23 26 34 35 20  |       LDY #&45 |
00001bc0  20 20 20 20 20 5c 20 6e  75 6d 62 65 72 20 6f 66  |     \ number of|
00001bd0  20 73 65 63 74 6f 72 73  0d 20 31 30 38 30 20 20  | sectors. 1080  |
00001be0  20 20 20 20 20 20 20 4a  53 52 20 73 65 74 75 70  |       JSR setup|
00001bf0  0d 20 31 30 39 30 20 20  20 20 20 20 20 20 20 4c  |. 1090         L|
00001c00  44 41 20 23 26 37 46 0d  20 31 31 30 30 20 20 20  |DA #&7F. 1100   |
00001c10  20 20 20 20 20 20 4c 44  58 20 23 62 6c 6f 63 6b  |      LDX #block|
00001c20  20 4d 4f 44 20 32 35 36  0d 20 31 31 31 30 20 20  | MOD 256. 1110  |
00001c30  20 20 20 20 20 20 20 4c  44 59 20 23 62 6c 6f 63  |       LDY #bloc|
00001c40  6b 20 44 49 56 20 32 35  36 0d 20 31 31 32 30 20  |k DIV 256. 1120 |
00001c50  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 77 6f  |        JSR oswo|
00001c60  72 64 20 20 20 20 5c 20  66 6f 72 6d 61 74 20 74  |rd    \ format t|
00001c70  72 61 63 6b 20 77 69 74  68 20 35 20 73 65 63 74  |rack with 5 sect|
00001c80  6f 72 73 0d 20 31 31 33  30 20 20 20 20 20 20 20  |ors. 1130       |
00001c90  20 20 4c 44 41 20 72 65  73 75 6c 74 20 20 20 20  |  LDA result    |
00001ca0  5c 20 6c 6f 61 64 20 72  65 73 75 6c 74 20 62 79  |\ load result by|
00001cb0  74 65 0d 20 31 31 34 30  20 20 20 20 20 20 20 20  |te. 1140        |
00001cc0  20 42 4e 45 20 65 72 72  6f 72 20 20 20 20 20 5c  | BNE error     \|
00001cd0  20 71 75 69 74 20 69 66  20 65 72 72 6f 72 0d 20  | quit if error. |
00001ce0  31 31 35 30 20 20 20 20  20 20 20 20 20 4c 44 41  |1150         LDA|
00001cf0  20 74 72 61 63 6b 20 20  20 20 20 5c 20 6c 6f 61  | track     \ loa|
00001d00  64 20 74 72 61 63 6b 20  6e 75 6d 62 65 72 0d 20  |d track number. |
00001d10  31 31 36 30 20 20 20 20  20 20 20 20 20 50 48 41  |1160         PHA|
00001d20  0d 20 31 31 37 30 20 20  20 20 20 20 20 20 20 4a  |. 1170         J|
00001d30  53 52 20 70 72 69 6e 74  62 79 74 65 20 5c 20 70  |SR printbyte \ p|
00001d40  72 69 6e 74 20 74 72 61  63 6b 20 6e 75 6d 62 65  |rint track numbe|
00001d50  72 0d 20 31 31 38 30 20  20 20 20 20 20 20 20 20  |r. 1180         |
00001d60  50 4c 41 0d 20 31 31 39  30 20 20 20 20 20 20 20  |PLA. 1190       |
00001d70  20 20 43 4d 50 20 66 69  6e 69 73 68 20 20 20 20  |  CMP finish    |
00001d80  5c 20 69 73 20 74 68 61  74 20 74 68 65 20 6c 61  |\ is that the la|
00001d90  73 74 20 74 72 61 63 6b  3f 0d 20 31 32 30 30 20  |st track?. 1200 |
00001da0  20 20 20 20 20 20 20 20  42 43 43 20 6c 6f 6f 70  |        BCC loop|
00001db0  20 20 20 20 20 20 5c 20  62 72 61 6e 63 68 20 69  |      \ branch i|
00001dc0  66 20 6d 6f 72 65 20 74  72 61 63 6b 73 20 74 6f  |f more tracks to|
00001dd0  20 66 6f 72 6d 61 74 0d  20 31 32 31 30 20 20 20  | format. 1210   |
00001de0  20 20 20 20 20 20 4c 44  58 20 23 61 6e 6f 74 68  |      LDX #anoth|
00001df0  65 72 20 4d 4f 44 20 32  35 36 0d 20 31 32 32 30  |er MOD 256. 1220|
00001e00  20 20 20 20 20 20 20 20  20 4c 44 59 20 23 61 6e  |         LDY #an|
00001e10  6f 74 68 65 72 20 44 49  56 20 32 35 36 0d 20 31  |other DIV 256. 1|
00001e20  32 33 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |230         JSR |
00001e30  70 72 69 6e 74 20 20 20  20 20 5c 20 61 6e 6f 74  |print     \ anot|
00001e40  68 65 72 3f 0d 20 31 32  34 30 20 20 20 20 20 20  |her?. 1240      |
00001e50  20 20 20 4a 53 52 20 6f  73 72 64 63 68 0d 20 31  |   JSR osrdch. 1|
00001e60  32 35 30 20 20 20 20 20  20 20 20 20 42 43 53 20  |250         BCS |
00001e70  65 73 63 61 70 65 0d 20  31 32 36 30 20 20 20 20  |escape. 1260    |
00001e80  20 20 20 20 20 50 48 41  20 20 20 20 20 20 20 20  |     PHA        |
00001e90  20 20 20 5c 20 74 65 6d  70 20 73 74 6f 72 65 20  |   \ temp store |
00001ea0  66 6f 72 20 61 6e 73 77  65 72 0d 20 31 32 37 30  |for answer. 1270|
00001eb0  20 20 20 20 20 20 20 20  20 4a 53 52 20 6f 73 61  |         JSR osa|
00001ec0  73 63 69 20 20 20 20 5c  20 70 72 69 6e 74 20 61  |sci    \ print a|
00001ed0  6e 73 77 65 72 0d 20 31  32 38 30 20 20 20 20 20  |nswer. 1280     |
00001ee0  20 20 20 20 4a 53 52 20  6f 73 6e 65 77 6c 0d 20  |    JSR osnewl. |
00001ef0  31 32 39 30 20 20 20 20  20 20 20 20 20 50 4c 41  |1290         PLA|
00001f00  20 20 20 20 20 20 20 20  20 20 20 5c 20 70 75 6c  |           \ pul|
00001f10  6c 20 61 6e 73 77 65 72  0d 20 31 33 30 30 20 20  |l answer. 1300  |
00001f20  20 20 20 20 20 20 20 41  4e 44 20 23 26 44 46 20  |       AND #&DF |
00001f30  20 20 20 20 20 5c 20 75  70 70 65 72 20 63 61 73  |     \ upper cas|
00001f40  65 0d 20 31 33 31 30 20  20 20 20 20 20 20 20 20  |e. 1310         |
00001f50  43 4d 50 20 23 41 53 43  28 22 59 22 29 0d 20 31  |CMP #ASC("Y"). 1|
00001f60  33 32 30 20 20 20 20 20  20 20 20 20 42 4e 45 20  |320         BNE |
00001f70  72 65 74 75 72 6e 0d 20  31 33 33 30 20 20 20 20  |return. 1330    |
00001f80  20 20 20 20 20 4a 4d 50  20 67 65 74 64 61 74 61  |     JMP getdata|
00001f90  0d 20 31 33 34 30 20 2e  73 65 74 75 70 0d 20 31  |. 1340 .setup. 1|
00001fa0  33 35 30 20 20 20 20 20  20 20 20 20 53 54 58 20  |350         STX |
00001fb0  67 61 70 33 0d 20 31 33  36 30 20 20 20 20 20 20  |gap3. 1360      |
00001fc0  20 20 20 53 54 59 20 6e  75 6d 73 65 63 74 6f 72  |   STY numsector|
00001fd0  73 0d 20 31 33 37 30 20  20 20 20 20 20 20 20 20  |s. 1370         |
00001fe0  4c 44 58 20 23 33 39 0d  20 31 33 38 30 20 20 20  |LDX #39. 1380   |
00001ff0  20 20 20 20 20 20 4c 44  59 20 74 72 61 63 6b 0d  |      LDY track.|
00002000  20 31 33 39 30 20 20 20  20 20 20 20 20 20 53 54  | 1390         ST|
00002010  59 20 70 68 79 73 69 63  61 6c 0d 20 31 34 30 30  |Y physical. 1400|
00002020  20 2e 73 65 74 6c 6f 6f  70 0d 20 31 34 31 30 20  | .setloop. 1410 |
00002030  20 20 20 20 20 20 20 20  53 54 41 20 74 61 62 6c  |        STA tabl|
00002040  65 2c 58 0d 20 31 34 32  30 20 20 20 20 20 20 20  |e,X. 1420       |
00002050  20 20 44 45 58 0d 20 31  34 33 30 20 20 20 20 20  |  DEX. 1430     |
00002060  20 20 20 20 44 45 58 0d  20 31 34 34 30 20 20 20  |    DEX. 1440   |
00002070  20 20 20 20 20 20 44 45  58 0d 20 31 34 35 30 20  |      DEX. 1450 |
00002080  20 20 20 20 20 20 20 20  50 48 41 0d 20 31 34 36  |        PHA. 146|
00002090  30 20 20 20 20 20 20 20  20 20 54 59 41 0d 20 31  |0         TYA. 1|
000020a0  34 37 30 20 20 20 20 20  20 20 20 20 53 54 41 20  |470         STA |
000020b0  74 61 62 6c 65 2c 58 0d  20 31 34 38 30 20 20 20  |table,X. 1480   |
000020c0  20 20 20 20 20 20 50 4c  41 0d 20 31 34 39 30 20  |      PLA. 1490 |
000020d0  20 20 20 20 20 20 20 20  44 45 58 0d 20 31 35 30  |        DEX. 150|
000020e0  30 20 20 20 20 20 20 20  20 20 42 50 4c 20 73 65  |0         BPL se|
000020f0  74 6c 6f 6f 70 0d 20 31  35 31 30 20 2e 72 65 74  |tloop. 1510 .ret|
00002100  75 72 6e 0d 20 31 35 32  30 20 20 20 20 20 20 20  |urn. 1520       |
00002110  20 20 52 54 53 0d 20 31  35 33 30 20 2e 70 72 69  |  RTS. 1530 .pri|
00002120  6e 74 0d 20 31 35 34 30  20 20 20 20 20 20 20 20  |nt. 1540        |
00002130  20 53 54 58 20 7a 65 72  6f 70 61 67 65 0d 20 31  | STX zeropage. 1|
00002140  35 35 30 20 20 20 20 20  20 20 20 20 53 54 59 20  |550         STY |
00002150  7a 65 72 6f 70 61 67 65  2b 31 0d 20 31 35 36 30  |zeropage+1. 1560|
00002160  20 20 20 20 20 20 20 20  20 4c 44 59 20 23 30 0d  |         LDY #0.|
00002170  20 31 35 37 30 20 2e 70  72 69 6e 74 6c 6f 6f 70  | 1570 .printloop|
00002180  0d 20 31 35 38 30 20 20  20 20 20 20 20 20 20 4c  |. 1580         L|
00002190  44 41 20 28 7a 65 72 6f  70 61 67 65 29 2c 59 0d  |DA (zeropage),Y.|
000021a0  20 31 35 39 30 20 20 20  20 20 20 20 20 20 42 45  | 1590         BE|
000021b0  51 20 65 6e 64 70 72 69  6e 74 0d 20 31 36 30 30  |Q endprint. 1600|
000021c0  20 20 20 20 20 20 20 20  20 4a 53 52 20 6f 73 61  |         JSR osa|
000021d0  73 63 69 0d 20 31 36 31  30 20 20 20 20 20 20 20  |sci. 1610       |
000021e0  20 20 49 4e 59 0d 20 31  36 32 30 20 20 20 20 20  |  INY. 1620     |
000021f0  20 20 20 20 42 4e 45 20  70 72 69 6e 74 6c 6f 6f  |    BNE printloo|
00002200  70 0d 20 31 36 33 30 20  2e 65 6e 64 70 72 69 6e  |p. 1630 .endprin|
00002210  74 0d 20 31 36 34 30 20  20 20 20 20 20 20 20 20  |t. 1640         |
00002220  52 54 53 0d 20 31 36 35  30 20 2e 70 72 69 6e 74  |RTS. 1650 .print|
00002230  62 79 74 65 0d 20 31 36  36 30 20 20 20 20 20 20  |byte. 1660      |
00002240  20 20 20 50 48 41 0d 20  31 36 37 30 20 20 20 20  |   PHA. 1670    |
00002250  20 20 20 20 20 4c 53 52  20 41 0d 20 31 36 38 30  |     LSR A. 1680|
00002260  20 20 20 20 20 20 20 20  20 4c 53 52 20 41 0d 20  |         LSR A. |
00002270  31 36 39 30 20 20 20 20  20 20 20 20 20 4c 53 52  |1690         LSR|
00002280  20 41 0d 20 31 37 30 30  20 20 20 20 20 20 20 20  | A. 1700        |
00002290  20 4c 53 52 20 41 0d 20  31 37 31 30 20 20 20 20  | LSR A. 1710    |
000022a0  20 20 20 20 20 4a 53 52  20 6e 79 62 62 6c 65 20  |     JSR nybble |
000022b0  20 20 20 5c 20 70 72 69  6e 74 20 4d 53 20 6e 79  |   \ print MS ny|
000022c0  62 62 6c 65 0d 20 31 37  32 30 20 20 20 20 20 20  |bble. 1720      |
000022d0  20 20 20 50 4c 41 0d 20  31 37 33 30 20 20 20 20  |   PLA. 1730    |
000022e0  20 20 20 20 20 4a 53 52  20 6e 79 62 62 6c 65 20  |     JSR nybble |
000022f0  20 20 20 5c 20 70 72 69  6e 74 20 4c 53 20 6e 79  |   \ print LS ny|
00002300  62 62 6c 65 0d 20 31 37  34 30 20 20 20 20 20 20  |bble. 1740      |
00002310  20 20 20 4c 44 41 20 23  41 53 43 28 22 20 22 29  |   LDA #ASC(" ")|
00002320  0d 20 31 37 35 30 20 20  20 20 20 20 20 20 20 4a  |. 1750         J|
00002330  53 52 20 6f 73 77 72 63  68 20 20 20 20 5c 20 70  |SR oswrch    \ p|
00002340  72 69 6e 74 20 73 70 61  63 65 0d 20 31 37 36 30  |rint space. 1760|
00002350  20 20 20 20 20 20 20 20  20 4a 4d 50 20 6f 73 77  |         JMP osw|
00002360  72 63 68 20 20 20 20 5c  20 70 72 69 6e 74 20 73  |rch    \ print s|
00002370  70 61 63 65 0d 20 31 37  37 30 20 2e 6e 79 62 62  |pace. 1770 .nybb|
00002380  6c 65 0d 20 31 37 38 30  20 20 20 20 20 20 20 20  |le. 1780        |
00002390  20 41 4e 44 20 23 26 30  46 0d 20 31 37 39 30 20  | AND #&0F. 1790 |
000023a0  20 20 20 20 20 20 20 20  53 45 44 0d 20 31 38 30  |        SED. 180|
000023b0  30 20 20 20 20 20 20 20  20 20 43 4c 43 0d 20 31  |0         CLC. 1|
000023c0  38 31 30 20 20 20 20 20  20 20 20 20 41 44 43 20  |810         ADC |
000023d0  23 26 39 30 0d 20 31 38  32 30 20 20 20 20 20 20  |#&90. 1820      |
000023e0  20 20 20 41 44 43 20 23  26 34 30 0d 20 31 38 33  |   ADC #&40. 183|
000023f0  30 20 20 20 20 20 20 20  20 20 43 4c 44 0d 20 31  |0         CLD. 1|
00002400  38 34 30 20 20 20 20 20  20 20 20 20 4a 4d 50 20  |840         JMP |
00002410  6f 73 77 72 63 68 20 20  20 20 5c 20 70 72 69 6e  |oswrch    \ prin|
00002420  74 20 6e 79 62 62 6c 65  20 61 6e 64 20 72 65 74  |t nybble and ret|
00002430  75 72 6e 0d 20 31 38 35  30 20 2e 62 6c 6f 63 6b  |urn. 1850 .block|
00002440  0d 20 31 38 36 30 20 20  20 20 20 20 20 20 20 45  |. 1860         E|
00002450  51 55 42 20 26 30 30 20  20 20 20 20 20 5c 20 64  |QUB &00      \ d|
00002460  72 69 76 65 20 6e 75 6d  62 65 72 20 30 2d 33 0d  |rive number 0-3.|
00002470  20 31 38 37 30 20 20 20  20 20 20 20 20 20 45 51  | 1870         EQ|
00002480  55 44 20 74 61 62 6c 65  20 20 20 20 5c 20 73 65  |UD table    \ se|
00002490  63 74 6f 72 20 74 61 62  6c 65 0d 20 31 38 38 30  |ctor table. 1880|
000024a0  20 20 20 20 20 20 20 20  20 45 51 55 42 20 26 30  |         EQUB &0|
000024b0  35 20 20 20 20 20 20 5c  20 35 20 70 61 72 61 6d  |5      \ 5 param|
000024c0  65 74 65 72 73 0d 20 31  38 39 30 20 20 20 20 20  |eters. 1890     |
000024d0  20 20 20 20 45 51 55 42  20 26 36 33 20 20 20 20  |    EQUB &63    |
000024e0  20 20 5c 20 66 6f 72 6d  61 74 20 74 72 61 63 6b  |  \ format track|
000024f0  0d 20 31 39 30 30 20 2e  70 68 79 73 69 63 61 6c  |. 1900 .physical|
00002500  0d 20 31 39 31 30 20 20  20 20 20 20 20 20 20 45  |. 1910         E|
00002510  51 55 42 20 26 30 30 20  20 20 20 20 20 5c 20 70  |QUB &00      \ p|
00002520  68 79 73 69 63 61 6c 20  74 72 61 63 6b 20 6e 75  |hysical track nu|
00002530  6d 62 65 72 20 30 0d 20  31 39 32 30 20 2e 67 61  |mber 0. 1920 .ga|
00002540  70 33 0d 20 31 39 33 30  20 20 20 20 20 20 20 20  |p3. 1930        |
00002550  20 45 51 55 42 20 26 31  35 20 20 20 20 20 20 5c  | EQUB &15      \|
00002560  20 67 61 70 20 33 0d 20  31 39 34 30 20 2e 6e 75  | gap 3. 1940 .nu|
00002570  6d 73 65 63 74 6f 72 73  0d 20 31 39 35 30 20 20  |msectors. 1950  |
00002580  20 20 20 20 20 20 20 45  51 55 42 20 26 32 41 20  |       EQUB &2A |
00002590  20 20 20 20 20 5c 20 31  30 20 73 65 63 74 6f 72  |     \ 10 sector|
000025a0  73 20 6f 66 20 32 35 36  20 62 79 74 65 73 0d 20  |s of 256 bytes. |
000025b0  31 39 36 30 20 20 20 20  20 20 20 20 20 45 51 55  |1960         EQU|
000025c0  42 20 26 30 30 20 20 20  20 20 20 5c 20 67 61 70  |B &00      \ gap|
000025d0  20 35 0d 20 31 39 37 30  20 20 20 20 20 20 20 20  | 5. 1970        |
000025e0  20 45 51 55 42 20 26 31  30 20 20 20 20 20 20 5c  | EQUB &10      \|
000025f0  20 67 61 70 20 31 0d 20  31 39 38 30 20 2e 72 65  | gap 1. 1980 .re|
00002600  73 75 6c 74 0d 20 31 39  39 30 20 20 20 20 20 20  |sult. 1990      |
00002610  20 20 20 45 51 55 42 20  26 30 30 20 20 20 20 20  |   EQUB &00     |
00002620  20 5c 20 72 65 73 75 6c  74 20 62 79 74 65 0d 20  | \ result byte. |
00002630  32 30 30 30 20 2e 74 61  62 6c 65 0d 20 32 30 31  |2000 .table. 201|
00002640  30 20 20 20 20 20 20 20  20 20 45 51 55 44 20 26  |0         EQUD &|
00002650  30 30 30 30 30 30 30 30  0d 20 32 30 32 30 20 20  |00000000. 2020  |
00002660  20 20 20 20 20 20 20 45  51 55 44 20 26 30 30 30  |       EQUD &000|
00002670  31 30 30 30 30 0d 20 32  30 33 30 20 20 20 20 20  |10000. 2030     |
00002680  20 20 20 20 45 51 55 44  20 26 30 30 30 32 30 30  |    EQUD &000200|
00002690  30 30 0d 20 32 30 34 30  20 20 20 20 20 20 20 20  |00. 2040        |
000026a0  20 45 51 55 44 20 26 30  30 30 33 30 30 30 30 0d  | EQUD &00030000.|
000026b0  20 32 30 35 30 20 20 20  20 20 20 20 20 20 45 51  | 2050         EQ|
000026c0  55 44 20 26 30 30 30 34  30 30 30 30 0d 20 32 30  |UD &00040000. 20|
000026d0  36 30 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |60         EQUD |
000026e0  26 30 30 30 35 30 30 30  30 0d 20 32 30 37 30 20  |&00050000. 2070 |
000026f0  20 20 20 20 20 20 20 20  45 51 55 44 20 26 30 30  |        EQUD &00|
00002700  30 36 30 30 30 30 0d 20  32 30 38 30 20 20 20 20  |060000. 2080    |
00002710  20 20 20 20 20 45 51 55  44 20 26 30 30 30 37 30  |     EQUD &00070|
00002720  30 30 30 0d 20 32 30 39  30 20 20 20 20 20 20 20  |000. 2090       |
00002730  20 20 45 51 55 44 20 26  30 30 30 38 30 30 30 30  |  EQUD &00080000|
00002740  0d 20 32 31 30 30 20 20  20 20 20 20 20 20 20 45  |. 2100         E|
00002750  51 55 44 20 26 30 30 30  39 30 30 30 30 0d 20 32  |QUD &00090000. 2|
00002760  31 31 30 20 2e 63 61 74  61 6c 6f 67 75 65 0d 20  |110 .catalogue. |
00002770  32 31 32 30 20 20 20 20  20 20 20 20 20 45 51 55  |2120         EQU|
00002780  42 20 26 31 35 20 20 20  20 20 20 5c 20 64 69 73  |B &15      \ dis|
00002790  63 20 74 69 74 6c 65 20  28 64 69 73 61 62 6c 65  |c title (disable|
000027a0  20 56 44 55 29 0d 20 32  31 33 30 20 20 20 20 20  | VDU). 2130     |
000027b0  20 20 20 20 4f 50 54 20  46 4e 66 69 6c 6c 28 37  |    OPT FNfill(7|
000027c0  29 20 5c 20 37 20 7a 65  72 6f 20 62 79 74 65 73  |) \ 7 zero bytes|
000027d0  0d 20 32 31 34 30 20 20  20 20 20 20 20 20 20 45  |. 2140         E|
000027e0  51 55 53 20 22 21 42 4f  4f 54 20 20 24 22 20 5c  |QUS "!BOOT  $" \|
000027f0  20 6e 65 78 74 20 38 20  62 79 74 65 73 0d 20 32  | next 8 bytes. 2|
00002800  31 35 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |150         OPT |
00002810  46 4e 66 69 6c 6c 28 32  34 30 29 20 5c 20 65 6e  |FNfill(240) \ en|
00002820  64 20 6f 66 20 66 69 72  73 74 20 73 65 63 74 6f  |d of first secto|
00002830  72 0d 20 32 31 36 30 20  20 20 20 20 20 20 20 20  |r. 2160         |
00002840  4f 50 54 20 46 4e 66 69  6c 6c 28 35 29 20 5c 20  |OPT FNfill(5) \ |
00002850  73 74 61 72 74 20 6f 66  20 73 65 63 6f 6e 64 20  |start of second |
00002860  73 65 63 74 6f 72 0d 20  32 31 37 30 20 20 20 20  |sector. 2170    |
00002870  20 20 20 20 20 45 51 55  42 20 26 30 38 20 20 20  |     EQUB &08   |
00002880  20 20 20 5c 20 6e 75 6d  62 65 72 20 6f 66 20 66  |   \ number of f|
00002890  69 6c 65 73 20 2a 20 38  0d 20 32 31 38 30 20 20  |iles * 8. 2180  |
000028a0  20 20 20 20 20 20 20 45  51 55 57 20 26 30 41 32  |       EQUW &0A2|
000028b0  30 20 20 20 20 5c 20 31  30 20 73 65 63 74 6f 72  |0    \ 10 sector|
000028c0  73 20 61 6e 64 20 2a 4f  50 54 20 34 2c 32 0d 20  |s and *OPT 4,2. |
000028d0  32 31 39 30 20 20 20 20  20 20 20 20 20 45 51 55  |2190         EQU|
000028e0  44 20 26 30 30 20 20 20  20 20 20 5c 20 6c 6f 61  |D &00      \ loa|
000028f0  64 20 61 6e 64 20 65 78  65 63 20 3d 20 26 30 30  |d and exec = &00|
00002900  30 30 0d 20 32 32 30 30  20 20 20 20 20 20 20 20  |00. 2200        |
00002910  20 45 51 55 57 20 26 30  38 30 30 20 20 20 20 5c  | EQUW &0800    \|
00002920  20 6c 65 6e 67 74 68 20  3d 20 26 38 30 30 20 62  | length = &800 b|
00002930  79 74 65 73 0d 20 32 32  31 30 20 20 20 20 20 20  |ytes. 2210      |
00002940  20 20 20 45 51 55 42 20  26 30 30 20 20 20 20 20  |   EQUB &00     |
00002950  20 5c 20 4d 53 20 32 20  62 69 74 73 20 6f 66 20  | \ MS 2 bits of |
00002960  73 65 63 74 6f 72 20 6e  75 6d 62 65 72 0d 20 32  |sector number. 2|
00002970  32 32 30 20 20 20 20 20  20 20 20 20 45 51 55 42  |220         EQUB|
00002980  20 26 30 32 20 20 20 20  20 20 5c 20 73 74 61 72  | &02      \ star|
00002990  74 69 6e 67 20 61 74 20  73 65 63 74 6f 72 20 32  |ting at sector 2|
000029a0  0d 20 32 32 33 30 20 20  20 20 20 20 20 20 20 4f  |. 2230         O|
000029b0  50 54 20 46 4e 66 69 6c  6c 28 32 34 30 29 0d 20  |PT FNfill(240). |
000029c0  32 32 34 30 20 2e 63 61  74 62 6c 6f 63 6b 0d 20  |2240 .catblock. |
000029d0  32 32 35 30 20 20 20 20  20 20 20 20 20 45 51 55  |2250         EQU|
000029e0  42 20 26 30 30 20 20 20  20 20 20 5c 20 64 72 69  |B &00      \ dri|
000029f0  76 65 20 6e 75 6d 62 65  72 0d 20 32 32 36 30 20  |ve number. 2260 |
00002a00  20 20 20 20 20 20 20 20  45 51 55 44 20 63 61 74  |        EQUD cat|
00002a10  61 6c 6f 67 75 65 20 5c  20 61 64 64 72 65 73 73  |alogue \ address|
00002a20  20 6f 66 20 62 75 66 66  65 72 0d 20 32 32 37 30  | of buffer. 2270|
00002a30  20 20 20 20 20 20 20 20  20 45 51 55 42 20 26 30  |         EQUB &0|
00002a40  33 20 20 20 20 20 20 5c  20 6e 75 6d 62 65 72 20  |3      \ number |
00002a50  6f 66 20 70 61 72 61 6d  65 74 65 72 73 0d 20 32  |of parameters. 2|
00002a60  32 38 30 20 20 20 20 20  20 20 20 20 45 51 55 42  |280         EQUB|
00002a70  20 26 34 42 20 20 20 20  20 20 5c 20 73 61 76 65  | &4B      \ save|
00002a80  20 64 61 74 61 20 6d 75  6c 74 69 20 73 65 63 74  | data multi sect|
00002a90  6f 72 0d 20 32 32 39 30  20 20 20 20 20 20 20 20  |or. 2290        |
00002aa0  20 45 51 55 42 20 26 30  30 20 20 20 20 20 20 5c  | EQUB &00      \|
00002ab0  20 6c 6f 67 69 63 61 6c  20 74 72 61 63 6b 0d 20  | logical track. |
00002ac0  32 33 30 30 20 20 20 20  20 20 20 20 20 45 51 55  |2300         EQU|
00002ad0  42 20 26 30 30 20 20 20  20 20 20 5c 20 73 74 61  |B &00      \ sta|
00002ae0  72 74 20 6c 6f 67 69 63  61 6c 20 73 65 63 74 6f  |rt logical secto|
00002af0  72 0d 20 32 33 31 30 20  20 20 20 20 20 20 20 20  |r. 2310         |
00002b00  45 51 55 42 20 26 32 32  20 20 20 20 20 20 5c 20  |EQUB &22      \ |
00002b10  32 20 73 65 63 74 6f 72  73 20 6f 66 20 32 35 36  |2 sectors of 256|
00002b20  20 62 79 74 65 73 0d 20  32 33 32 30 20 2e 63 61  | bytes. 2320 .ca|
00002b30  74 72 65 73 75 6c 74 0d  20 32 33 33 30 20 20 20  |tresult. 2330   |
00002b40  20 20 20 20 20 20 45 51  55 42 20 26 30 30 20 20  |      EQUB &00  |
00002b50  20 20 20 20 5c 20 72 65  73 75 6c 74 20 62 79 74  |    \ result byt|
00002b60  65 0d 20 32 33 34 30 20  2e 74 69 74 6c 65 0d 20  |e. 2340 .title. |
00002b70  32 33 35 30 20 20 20 20  20 20 20 20 20 45 51 55  |2350         EQU|
00002b80  42 20 26 30 44 0d 20 32  33 36 30 20 20 20 20 20  |B &0D. 2360     |
00002b90  20 20 20 20 45 51 55 53  20 22 35 20 53 65 63 74  |    EQUS "5 Sect|
00002ba0  6f 72 20 44 46 53 20 46  6f 72 6d 61 74 22 0d 20  |or DFS Format". |
00002bb0  32 33 37 30 20 20 20 20  20 20 20 20 20 45 51 55  |2370         EQU|
00002bc0  42 20 26 30 44 0d 20 32  33 38 30 20 20 20 20 20  |B &0D. 2380     |
00002bd0  20 20 20 20 42 52 4b 0d  20 32 33 39 30 20 2e 64  |    BRK. 2390 .d|
00002be0  72 69 76 65 6e 75 6d 0d  20 32 34 30 30 20 20 20  |rivenum. 2400   |
00002bf0  20 20 20 20 20 20 45 51  55 42 20 26 30 44 0d 20  |      EQUB &0D. |
00002c00  32 34 31 30 20 20 20 20  20 20 20 20 20 45 51 55  |2410         EQU|
00002c10  53 20 22 44 72 69 76 65  20 6e 75 6d 62 65 72 3f  |S "Drive number?|
00002c20  20 28 30 2d 33 29 20 22  0d 20 32 34 32 30 20 20  | (0-3) ". 2420  |
00002c30  20 20 20 20 20 20 20 42  52 4b 0d 20 32 34 33 30  |       BRK. 2430|
00002c40  20 2e 74 72 61 63 6b 6e  75 6d 0d 20 32 34 34 30  | .tracknum. 2440|
00002c50  20 20 20 20 20 20 20 20  20 45 51 55 42 20 26 30  |         EQUB &0|
00002c60  44 0d 20 32 34 35 30 20  20 20 20 20 20 20 20 20  |D. 2450         |
00002c70  45 51 55 53 20 22 34 30  20 6f 72 20 38 30 20 74  |EQUS "40 or 80 t|
00002c80  72 61 63 6b 73 3f 20 28  34 2f 38 29 20 22 0d 20  |racks? (4/8) ". |
00002c90  32 34 36 30 20 20 20 20  20 20 20 20 20 42 52 4b  |2460         BRK|
00002ca0  0d 20 32 34 37 30 20 2e  72 65 61 64 79 0d 20 32  |. 2470 .ready. 2|
00002cb0  34 38 30 20 20 20 20 20  20 20 20 20 45 51 55 42  |480         EQUB|
00002cc0  20 26 30 44 0d 20 32 34  39 30 20 20 20 20 20 20  | &0D. 2490      |
00002cd0  20 20 20 45 51 55 53 20  22 52 65 61 64 79 20 74  |   EQUS "Ready t|
00002ce0  6f 20 66 6f 72 6d 61 74  3f 20 28 59 2f 4e 29 20  |o format? (Y/N) |
00002cf0  22 0d 20 32 35 30 30 20  20 20 20 20 20 20 20 20  |". 2500         |
00002d00  42 52 4b 0d 20 32 35 31  30 20 2e 61 6e 6f 74 68  |BRK. 2510 .anoth|
00002d10  65 72 0d 20 32 35 32 30  20 20 20 20 20 20 20 20  |er. 2520        |
00002d20  20 45 51 55 42 20 26 30  44 0d 20 32 35 33 30 20  | EQUB &0D. 2530 |
00002d30  20 20 20 20 20 20 20 20  45 51 55 53 20 22 41 6e  |        EQUS "An|
00002d40  6f 74 68 65 72 3f 20 28  59 2f 4e 29 20 22 0d 20  |other? (Y/N) ". |
00002d50  32 35 34 30 20 20 20 20  20 20 20 20 20 42 52 4b  |2540         BRK|
00002d60  0d 20 32 35 35 30 20 2e  74 72 61 63 6b 0d 20 32  |. 2550 .track. 2|
00002d70  35 36 30 20 20 20 20 20  20 20 20 20 45 51 55 42  |560         EQUB|
00002d80  20 26 30 30 20 20 20 20  20 20 5c 20 70 68 79 73  | &00      \ phys|
00002d90  69 63 61 6c 20 74 72 61  63 6b 20 6e 75 6d 62 65  |ical track numbe|
00002da0  72 0d 20 32 35 37 30 20  2e 66 69 6e 69 73 68 0d  |r. 2570 .finish.|
00002db0  20 32 35 38 30 20 20 20  20 20 20 20 20 20 45 51  | 2580         EQ|
00002dc0  55 42 20 26 30 30 20 20  20 20 20 20 5c 20 6c 61  |UB &00      \ la|
00002dd0  73 74 20 74 72 61 63 6b  20 6e 75 6d 62 65 72 0d  |st track number.|
00002de0  20 32 35 39 30 20 2e 6c  61 73 74 62 79 74 65 0d  | 2590 .lastbyte.|
00002df0  20 32 36 30 30 20 5d 0d  20 32 36 31 30 20 4e 45  | 2600 ]. 2610 NE|
00002e00  58 54 0d 20 32 36 32 30  20 49 4e 50 55 54 27 22  |XT. 2620 INPUT'"|
00002e10  53 61 76 65 20 66 69 6c  65 6e 61 6d 65 20 3d 20  |Save filename = |
00002e20  22 66 69 6c 65 6e 61 6d  65 24 0d 20 32 36 33 30  |"filename$. 2630|
00002e30  20 49 46 20 66 69 6c 65  6e 61 6d 65 24 20 3d 20  | IF filename$ = |
00002e40  22 22 20 54 48 45 4e 20  45 4e 44 0d 20 32 36 34  |"" THEN END. 264|
00002e50  30 20 2a 4f 50 54 31 2c  32 0d 20 32 36 35 30 20  |0 *OPT1,2. 2650 |
00002e60  4f 53 43 4c 49 28 22 53  41 56 45 20 22 2b 66 69  |OSCLI("SAVE "+fi|
00002e70  6c 65 6e 61 6d 65 24 2b  22 20 22 2b 53 54 52 24  |lename$+" "+STR$|
00002e80  7e 28 6d 63 6f 64 65 29  2b 22 2b 22 2b 53 54 52  |~(mcode)+"+"+STR|
00002e90  24 7e 28 6c 61 73 0d 20  20 20 20 20 20 74 62 79  |$~(las.      tby|
00002ea0  74 65 2d 66 69 72 73 74  62 79 74 65 29 2b 22 20  |te-firstbyte)+" |
00002eb0  22 2b 53 54 52 24 7e 28  73 74 61 72 74 29 2b 22  |"+STR$~(start)+"|
00002ec0  20 22 2b 53 54 52 24 7e  28 66 69 72 73 74 62 79  | "+STR$~(firstby|
00002ed0  74 65 29 29 0d 20 32 36  36 30 20 2a 4f 50 54 31  |te)). 2660 *OPT1|
00002ee0  2c 30 0d 20 32 36 37 30  20 45 4e 44 0d 20 32 36  |,0. 2670 END. 26|
00002ef0  38 30 20 44 45 46 20 46  4e 66 69 6c 6c 28 73 69  |80 DEF FNfill(si|
00002f00  7a 65 29 0d 20 32 36 39  30 20 46 4f 52 20 63 6f  |ze). 2690 FOR co|
00002f10  75 6e 74 20 3d 20 31 20  54 4f 20 73 69 7a 65 0d  |unt = 1 TO size.|
00002f20  20 32 37 30 30 20 3f 4f  25 3d 30 0d 20 32 37 31  | 2700 ?O%=0. 271|
00002f30  30 20 4f 25 3d 4f 25 2b  31 0d 20 32 37 32 30 20  |0 O%=O%+1. 2720 |
00002f40  50 25 3d 50 25 2b 31 0d  20 32 37 33 30 20 4e 45  |P%=P%+1. 2730 NE|
00002f50  58 54 0d 20 32 37 34 30  20 3d 70 61 73 73 0d 0d  |XT. 2740 =pass..|
00002f60  0d 54 68 65 72 65 20 61  72 65 20 61 20 6e 75 6d  |.There are a num|
00002f70  62 65 72 20 6f 66 20 70  6f 69 6e 74 73 20 77 6f  |ber of points wo|
00002f80  72 74 68 20 6e 6f 74 69  6e 67 20 61 62 6f 75 74  |rth noting about|
00002f90  20 74 68 65 20 70 72 6f  67 72 61 6d 20 53 45 43  | the program SEC|
00002fa0  54 4f 52 35 2e 20 54 68  65 0d 6f 62 6a 65 63 74  |TOR5. The.object|
00002fb0  20 63 6f 64 65 20 69 73  20 75 73 65 64 20 74 6f  | code is used to|
00002fc0  20 63 72 65 61 74 65 20  61 20 35 20 73 65 63 74  | create a 5 sect|
00002fd0  6f 72 20 70 65 72 20 74  72 61 63 6b 20 66 6f 72  |or per track for|
00002fe0  6d 61 74 74 65 64 20 64  69 73 63 20 61 6e 64 2c  |matted disc and,|
00002ff0  20 66 6f 72 0d 74 68 65  20 73 61 6b 65 20 6f 66  | for.the sake of|
00003000  20 64 65 6d 6f 6e 73 74  72 61 74 69 6e 67 20 74  | demonstrating t|
00003010  68 65 20 70 72 6f 74 65  63 74 69 6f 6e 20 74 65  |he protection te|
00003020  63 68 6e 69 71 75 65 73  2c 20 74 68 65 20 6f 62  |chniques, the ob|
00003030  6a 65 63 74 20 63 6f 64  65 20 77 69 6c 6c 0d 61  |ject code will.a|
00003040  6c 73 6f 20 62 65 20 73  74 6f 72 65 64 20 6f 6e  |lso be stored on|
00003050  20 74 68 65 20 64 69 73  63 20 69 74 20 66 6f 72  | the disc it for|
00003060  6d 61 74 73 2e 20 54 68  65 20 70 72 6f 67 72 61  |mats. The progra|
00003070  6d 20 61 73 73 65 6d 62  6c 65 73 20 74 68 65 20  |m assembles the |
00003080  6f 62 6a 65 63 74 0d 63  6f 64 65 20 74 6f 20 72  |object.code to r|
00003090  75 6e 20 61 74 20 50 41  47 45 2b 26 31 30 30 2e  |un at PAGE+&100.|
000030a0  20 54 68 69 73 20 69 73  20 73 6f 20 74 68 61 74  | This is so that|
000030b0  20 74 68 65 20 70 72 6f  67 72 61 6d 73 20 77 68  | the programs wh|
000030c0  69 63 68 20 77 69 6c 6c  20 62 65 20 75 73 65 64  |ich will be used|
000030d0  0d 74 6f 20 73 74 6f 72  65 20 74 68 65 20 6f 62  |.to store the ob|
000030e0  6a 65 63 74 20 63 6f 64  65 20 6f 6e 20 61 20 70  |ject code on a p|
000030f0  72 6f 74 65 63 74 65 64  20 64 69 73 63 20 61 6e  |rotected disc an|
00003100  64 20 74 6f 20 72 65 61  64 20 74 68 61 74 20 63  |d to read that c|
00003110  6f 64 65 20 62 61 63 6b  0d 66 72 6f 6d 20 74 68  |ode back.from th|
00003120  65 20 64 69 73 63 20 63  61 6e 20 62 65 20 6c 6f  |e disc can be lo|
00003130  63 61 74 65 64 20 61 74  20 50 41 47 45 2e 20 54  |cated at PAGE. T|
00003140  68 65 73 65 20 73 61 76  69 6e 67 20 61 6e 64 20  |hese saving and |
00003150  6c 6f 61 64 69 6e 67 20  70 72 6f 67 72 61 6d 73  |loading programs|
00003160  0d 61 72 65 20 76 65 72  79 20 73 68 6f 72 74 20  |.are very short |
00003170  61 6e 64 20 26 31 30 30  20 62 79 74 65 73 20 69  |and &100 bytes i|
00003180  73 20 6d 6f 72 65 20 74  68 61 6e 20 65 6e 6f 75  |s more than enou|
00003190  67 68 20 72 6f 6f 6d 20  66 6f 72 20 74 68 65 6d  |gh room for them|
000031a0  2e 20 57 68 65 6e 20 79  6f 75 0d 64 65 73 69 67  |. When you.desig|
000031b0  6e 20 79 6f 75 72 20 6f  77 6e 20 70 72 6f 74 65  |n your own prote|
000031c0  63 74 69 6f 6e 20 73 79  73 74 65 6d 20 79 6f 75  |ction system you|
000031d0  20 6d 61 79 20 6e 65 65  64 20 6d 6f 72 65 20 73  | may need more s|
000031e0  70 61 63 65 20 66 6f 72  20 79 6f 75 72 20 73 61  |pace for your sa|
000031f0  76 69 6e 67 0d 61 6e 64  20 6c 6f 61 64 69 6e 67  |ving.and loading|
00003200  20 70 72 6f 67 72 61 6d  73 2e 0d 0d 54 68 65 20  | programs...The |
00003210  66 6f 72 6d 61 74 74 69  6e 67 20 70 72 6f 67 72  |formatting progr|
00003220  61 6d 20 69 6e 74 72 6f  64 75 63 65 64 20 69 6e  |am introduced in|
00003230  20 6d 6f 64 75 6c 65 20  33 20 63 72 65 61 74 65  | module 3 create|
00003240  64 20 61 6e 20 65 6d 70  74 79 20 63 61 74 61 6c  |d an empty catal|
00003250  6f 67 75 65 0d 77 68 69  63 68 20 6f 6e 6c 79 20  |ogue.which only |
00003260  63 6f 6e 74 61 69 6e 65  64 20 74 68 65 20 6e 75  |contained the nu|
00003270  6d 62 65 72 20 6f 66 20  73 65 63 74 6f 72 73 20  |mber of sectors |
00003280  61 76 61 69 6c 61 62 6c  65 20 6f 6e 20 74 68 65  |available on the|
00003290  20 64 69 73 63 2e 20 54  68 65 0d 63 61 74 61 6c  | disc. The.catal|
000032a0  6f 67 75 65 20 63 72 65  61 74 65 64 20 62 79 20  |ogue created by |
000032b0  74 68 65 20 70 72 6f 67  72 61 6d 20 61 62 6f 76  |the program abov|
000032c0  65 20 61 63 74 75 61 6c  6c 79 20 63 6f 6e 74 61  |e actually conta|
000032d0  69 6e 73 20 61 20 64 69  73 63 20 74 69 74 6c 65  |ins a disc title|
000032e0  2c 0d 73 6f 6d 65 20 66  69 6c 65 20 69 6e 66 6f  |,.some file info|
000032f0  72 6d 61 74 69 6f 6e 20  61 6e 64 20 74 68 65 20  |rmation and the |
00003300  73 74 61 72 74 20 75 70  20 6f 70 74 69 6f 6e 2e  |start up option.|
00003310  20 54 68 65 20 64 69 73  63 20 74 69 74 6c 65 20  | The disc title |
00003320  69 73 20 74 68 65 20 41  53 43 49 49 0d 63 68 61  |is the ASCII.cha|
00003330  72 61 63 74 65 72 20 26  31 35 20 77 68 69 63 68  |racter &15 which|
00003340  20 64 69 73 61 62 6c 65  73 20 74 68 65 20 56 44  | disables the VD|
00003350  55 20 61 6e 64 20 73 6f  20 70 72 65 76 65 6e 74  |U and so prevent|
00003360  73 20 74 68 65 20 64 69  73 63 20 62 65 69 6e 67  |s the disc being|
00003370  0d 63 61 74 61 6c 6f 67  75 65 64 2e 20 54 68 65  |.catalogued. The|
00003380  20 64 75 6d 6d 79 20 66  69 6c 65 20 24 2e 21 42  | dummy file $.!B|
00003390  4f 4f 54 20 69 73 20 65  6e 74 65 72 65 64 20 69  |OOT is entered i|
000033a0  6e 74 6f 20 74 68 65 20  63 61 74 61 6c 6f 67 75  |nto the catalogu|
000033b0  65 20 61 6e 64 20 69 74  20 69 73 0d 73 70 65 63  |e and it is.spec|
000033c0  69 66 69 65 64 20 61 73  20 26 38 30 30 20 62 79  |ified as &800 by|
000033d0  74 65 73 20 6c 6f 6e 67  20 73 74 61 72 74 69 6e  |tes long startin|
000033e0  67 20 69 6e 20 73 65 63  74 6f 72 20 26 30 32 2e  |g in sector &02.|
000033f0  20 54 68 69 73 20 6d 65  61 6e 73 20 74 68 61 74  | This means that|
00003400  20 74 68 65 0d 64 75 6d  6d 79 20 21 42 4f 4f 54  | the.dummy !BOOT|
00003410  20 66 69 6c 65 20 75 73  65 73 20 61 6c 6c 20 74  | file uses all t|
00003420  68 65 20 61 76 61 69 6c  61 62 6c 65 20 73 70 61  |he available spa|
00003430  63 65 20 6f 6e 20 74 72  61 63 6b 20 26 30 30 2e  |ce on track &00.|
00003440  20 54 68 65 20 6e 75 6d  62 65 72 20 6f 66 0d 61  | The number of.a|
00003450  76 61 69 6c 61 62 6c 65  20 73 65 63 74 6f 72 73  |vailable sectors|
00003460  20 6f 6e 20 74 68 65 20  64 69 73 63 20 69 73 20  | on the disc is |
00003470  73 70 65 63 69 66 69 65  64 20 61 73 20 26 30 41  |specified as &0A|
00003480  20 61 6e 64 20 73 6f 20  74 68 65 20 63 61 74 61  | and so the cata|
00003490  6c 6f 67 75 65 20 61 6e  64 0d 74 68 65 20 64 75  |logue and.the du|
000034a0  6d 6d 79 20 21 42 4f 4f  54 20 66 69 6c 65 20 75  |mmy !BOOT file u|
000034b0  73 65 20 61 6c 6c 20 74  68 65 20 61 76 61 69 6c  |se all the avail|
000034c0  61 62 6c 65 20 73 70 61  63 65 20 6f 6e 20 74 68  |able space on th|
000034d0  65 20 64 69 73 63 2e 20  54 68 65 20 73 74 61 72  |e disc. The star|
000034e0  74 20 75 70 0d 6f 70 74  69 6f 6e 20 69 73 20 65  |t up.option is e|
000034f0  71 75 69 76 61 6c 65 6e  74 20 74 6f 20 2a 4f 50  |quivalent to *OP|
00003500  54 20 34 2c 32 20 73 6f  20 74 68 61 74 20 74 68  |T 4,2 so that th|
00003510  65 20 21 42 4f 4f 54 20  66 69 6c 65 20 77 69 6c  |e !BOOT file wil|
00003520  6c 20 62 65 20 2a 52 55  4e 20 6f 6e 0d 53 68 69  |l be *RUN on.Shi|
00003530  66 74 2b 42 72 65 61 6b  2e 20 54 68 69 73 20 66  |ft+Break. This f|
00003540  6f 72 6d 61 74 74 69 6e  67 20 70 72 6f 67 72 61  |ormatting progra|
00003550  6d 20 70 72 6f 64 75 63  65 73 20 74 68 65 20 73  |m produces the s|
00003560  65 63 74 6f 72 20 6d 61  70 20 73 68 6f 77 6e 20  |ector map shown |
00003570  69 6e 0d 66 69 67 75 72  65 20 31 2e 20 59 6f 75  |in.figure 1. You|
00003580  20 63 61 6e 20 73 65 65  20 74 68 61 74 20 69 74  | can see that it|
00003590  20 68 61 73 20 6e 6f 74  20 62 65 65 6e 20 6f 70  | has not been op|
000035a0  74 69 6d 69 73 65 64 20  66 6f 72 20 73 70 65 65  |timised for spee|
000035b0  64 20 61 6e 64 20 79 6f  75 20 6d 61 79 0d 6c 69  |d and you may.li|
000035c0  6b 65 20 74 6f 20 6d 6f  64 69 66 79 20 75 73 69  |ke to modify usi|
000035d0  6e 67 20 74 68 65 20 6c  6f 67 69 63 61 6c 20 73  |ng the logical s|
000035e0  65 63 74 6f 72 20 6f 66  66 73 65 74 73 20 64 65  |ector offsets de|
000035f0  73 63 72 69 62 65 64 20  69 6e 20 6d 6f 64 75 6c  |scribed in modul|
00003600  65 20 33 2e 0d 0d 0d 20  20 20 20 20 20 20 20 20  |e 3....         |
00003610  20 20 20 20 20 20 20 20  20 20 20 44 46 53 20 66  |           DFS f|
00003620  6f 72 6d 61 74 20 70 68  79 73 69 63 61 6c 20 73  |ormat physical s|
00003630  65 63 74 6f 72 20 6e 75  6d 62 65 72 73 0d 20 20  |ector numbers.  |
00003640  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 0d  |               .|
00003650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003660  7c 20 30 30 20 20 30 31  20 20 30 32 20 20 30 33  || 00  01  02  03|
00003670  20 20 30 34 20 20 30 35  20 20 30 36 20 20 30 37  |  04  05  06  07|
00003680  20 20 30 38 20 20 30 39  0d 20 20 20 20 20 20 20  |  08  09.       |
00003690  20 20 20 20 20 20 2d 2d  2d 2b 2d 2d 2d 2d 2d 2d  |      ---+------|
000036a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000036c0  2d 0d 20 20 20 20 20 20  20 20 20 20 54 20 20 30  |-.          T  0|
000036d0  30 20 7c 20 30 30 20 20  30 31 20 20 30 32 20 20  |0 | 00  01  02  |
000036e0  30 33 20 20 30 34 20 20  30 35 20 20 30 36 20 20  |03  04  05  06  |
000036f0  30 37 20 20 30 38 20 20  30 39 0d 20 20 20 20 20  |07  08  09.     |
00003700  20 20 20 20 20 72 20 20  30 31 20 7c 20 20 20 30  |     r  01 |   0|
00003710  31 20 20 20 20 20 20 30  32 20 20 20 20 20 20 30  |1      02      0|
00003720  33 20 20 20 20 20 20 30  34 20 20 20 20 20 20 30  |3      04      0|
00003730  35 20 20 20 20 4c 6f 67  69 63 61 6c 0d 20 20 20  |5    Logical.   |
00003740  20 20 20 20 20 20 20 61  20 20 30 32 20 7c 20 20  |       a  02 |  |
00003750  20 30 31 20 20 20 20 20  20 30 32 20 20 20 20 20  | 01      02     |
00003760  20 30 33 20 20 20 20 20  20 30 34 20 20 20 20 20  | 03      04     |
00003770  20 30 35 20 20 20 20 73  65 63 74 6f 72 0d 20 20  | 05    sector.  |
00003780  20 20 20 20 20 20 20 20  63 20 20 30 33 20 7c 20  |        c  03 | |
00003790  20 20 30 31 20 20 20 20  20 20 30 32 20 20 20 20  |  01      02    |
000037a0  20 20 30 33 20 20 20 20  20 20 30 34 20 20 20 20  |  03      04    |
000037b0  20 20 30 35 20 20 20 20  6e 75 6d 62 65 72 73 0d  |  05    numbers.|
000037c0  20 20 20 20 20 20 20 20  20 20 6b 20 20 30 34 20  |          k  04 |
000037d0  7c 20 20 20 30 31 20 20  20 20 20 20 30 32 20 20  ||   01      02  |
000037e0  20 20 20 20 30 33 20 20  20 20 20 20 30 34 20 20  |    03      04  |
000037f0  20 20 20 20 30 35 0d 20  20 20 20 20 20 20 20 20  |    05.         |
00003800  20 73 20 20 30 35 20 7c  20 20 20 30 31 20 2e 2e  | s  05 |   01 ..|
00003810  2e 0d 0d 0d 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00003820  46 69 67 75 72 65 20 31  2e 20 54 68 65 20 64 69  |Figure 1. The di|
00003830  73 74 72 69 62 75 74 69  6f 6e 20 6f 66 20 6c 6f  |stribution of lo|
00003840  67 69 63 61 6c 20 73 65  63 74 6f 72 73 0d 20 20  |gical sectors.  |
00003850  20 20 20 20 20 20 20 20  20 20 2d 2d 2d 2d 2d 2d  |          ------|
00003860  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003880  2d 2d 2d 2d 2d 2d 2d 0d  0d 0d 57 68 65 6e 20 74  |-------...When t|
00003890  68 65 20 64 69 73 63 20  68 61 73 20 62 65 65 6e  |he disc has been|
000038a0  20 66 6f 72 6d 61 74 74  65 64 20 79 6f 75 20 63  | formatted you c|
000038b0  61 6e 20 75 73 65 20 74  68 65 20 70 72 6f 67 72  |an use the progr|
000038c0  61 6d 20 49 44 53 44 55  4d 50 20 28 66 72 6f 6d  |am IDSDUMP (from|
000038d0  0d 6d 6f 64 75 6c 65 20  30 29 20 74 6f 20 63 68  |.module 0) to ch|
000038e0  65 63 6b 20 74 68 65 20  49 44 20 66 69 65 6c 64  |eck the ID field|
000038f0  73 20 61 6e 64 20 74 68  65 20 70 72 6f 67 72 61  |s and the progra|
00003900  6d 20 56 45 52 49 46 59  20 28 61 6c 73 6f 20 66  |m VERIFY (also f|
00003910  72 6f 6d 20 6d 6f 64 75  6c 65 0d 30 29 20 74 6f  |rom module.0) to|
00003920  20 76 65 72 69 66 79 20  74 68 65 20 66 6f 72 6d  | verify the form|
00003930  61 74 2e 0d 0d 54 68 65  20 6f 62 6a 65 63 74 20  |at...The object |
00003940  63 6f 64 65 20 70 72 6f  67 72 61 6d 20 46 4f 52  |code program FOR|
00003950  4d 35 2c 20 77 68 69 63  68 20 69 73 20 75 73 65  |M5, which is use|
00003960  64 20 74 6f 20 66 6f 72  6d 61 74 20 74 68 65 20  |d to format the |
00003970  64 69 73 63 2c 20 63 61  6e 20 62 65 0d 73 74 6f  |disc, can be.sto|
00003980  72 65 64 20 6f 6e 20 74  68 65 20 6e 65 77 6c 79  |red on the newly|
00003990  20 66 6f 72 6d 61 74 74  65 64 20 64 69 73 63 20  | formatted disc |
000039a0  75 73 69 6e 67 20 74 68  65 20 6f 62 6a 65 63 74  |using the object|
000039b0  20 63 6f 64 65 20 67 65  6e 65 72 61 74 65 64 20  | code generated |
000039c0  62 79 20 74 68 65 0d 70  72 6f 67 72 61 6d 20 45  |by the.program E|
000039d0  4e 43 4f 44 45 2e 20 52  75 6e 20 45 4e 43 4f 44  |NCODE. Run ENCOD|
000039e0  45 20 61 6e 64 20 63 68  6f 6f 73 65 20 61 20 73  |E and choose a s|
000039f0  75 69 74 61 62 6c 65 20  66 69 6c 65 6e 61 6d 65  |uitable filename|
00003a00  20 66 6f 72 20 74 68 65  20 6f 62 6a 65 63 74 0d  | for the object.|
00003a10  63 6f 64 65 20 69 74 20  70 72 6f 64 75 63 65 73  |code it produces|
00003a20  20 77 68 65 6e 20 70 72  6f 6d 70 74 65 64 2e 20  | when prompted. |
00003a30  46 6f 72 20 74 68 65 20  73 61 6b 65 20 6f 66 20  |For the sake of |
00003a40  74 68 69 73 20 64 65 6d  6f 6e 73 74 72 61 74 69  |this demonstrati|
00003a50  6f 6e 20 49 20 77 69 6c  6c 0d 61 73 73 75 6d 65  |on I will.assume|
00003a60  20 74 68 61 74 20 79 6f  75 20 77 69 6c 6c 20 63  | that you will c|
00003a70  61 6c 6c 20 69 74 20 53  41 56 45 35 2e 20 54 68  |all it SAVE5. Th|
00003a80  65 20 6f 62 6a 65 63 74  20 63 6f 64 65 20 70 72  |e object code pr|
00003a90  6f 67 72 61 6d 20 53 41  56 45 35 20 77 69 6c 6c  |ogram SAVE5 will|
00003aa0  0d 73 61 76 65 20 74 68  65 20 26 34 30 30 20 62  |.save the &400 b|
00003ab0  79 74 65 20 70 72 6f 67  72 61 6d 20 46 4f 52 4d  |yte program FORM|
00003ac0  35 20 6f 6e 74 6f 20 74  68 65 20 66 69 72 73 74  |5 onto the first|
00003ad0  20 74 77 6f 20 6c 6f 67  69 63 61 6c 20 73 65 63  | two logical sec|
00003ae0  74 6f 72 73 20 6f 66 0d  74 72 61 63 6b 20 26 30  |tors of.track &0|
00003af0  31 2c 20 73 74 6f 72 69  6e 67 20 74 68 65 20 64  |1, storing the d|
00003b00  61 74 61 20 61 73 20 64  65 6c 65 74 65 64 20 64  |ata as deleted d|
00003b10  61 74 61 2e 0d 0d 2a 4c  4f 41 44 20 46 4f 52 4d  |ata...*LOAD FORM|
00003b20  35 20 61 6e 64 20 74 68  65 6e 20 74 79 70 65 20  |5 and then type |
00003b30  2a 52 55 4e 20 53 41 56  45 35 2e 20 53 77 61 70  |*RUN SAVE5. Swap|
00003b40  20 74 68 65 20 44 46 53  20 64 69 73 63 20 66 6f  | the DFS disc fo|
00003b50  72 20 74 68 65 20 6e 65  77 6c 79 0d 66 6f 72 6d  |r the newly.form|
00003b60  61 74 74 65 64 20 35 20  73 65 63 74 6f 72 20 70  |atted 5 sector p|
00003b70  65 72 20 74 72 61 63 6b  20 64 69 73 63 20 61 6e  |er track disc an|
00003b80  64 20 70 72 65 73 73 20  74 68 65 20 73 70 61 63  |d press the spac|
00003b90  65 62 61 72 2e 20 54 68  65 20 6f 62 6a 65 63 74  |ebar. The object|
00003ba0  20 63 6f 64 65 0d 70 72  6f 67 72 61 6d 20 46 4f  | code.program FO|
00003bb0  52 4d 35 20 77 69 6c 6c  20 62 65 20 73 74 6f 72  |RM5 will be stor|
00003bc0  65 64 20 6f 6e 20 74 68  65 20 64 69 73 63 2e 20  |ed on the disc. |
00003bd0  59 6f 75 20 63 61 6e 20  75 73 65 20 74 68 65 20  |You can use the |
00003be0  70 72 6f 67 72 61 6d 20  56 45 52 49 46 59 0d 74  |program VERIFY.t|
00003bf0  6f 20 6d 61 6b 65 20 73  75 72 65 20 74 68 61 74  |o make sure that|
00003c00  20 74 68 65 20 64 61 74  61 20 69 73 20 73 75 63  | the data is suc|
00003c10  65 73 73 66 75 6c 6c 79  20 73 74 6f 72 65 64 20  |essfully stored |
00003c20  61 73 20 64 65 6c 65 74  65 64 20 64 61 74 61 2e  |as deleted data.|
00003c30  0d 0d 0d 20 20 20 31 30  20 52 45 4d 3a 20 45 4e  |...   10 REM: EN|
00003c40  43 4f 44 45 0d 20 20 20  32 30 20 44 49 4d 20 6d  |CODE.   20 DIM m|
00003c50  63 6f 64 65 20 26 31 30  30 0d 20 20 20 32 35 20  |code &100.   25 |
00003c60  70 61 67 65 3d 50 41 47  45 0d 20 20 20 33 30 20  |page=PAGE.   30 |
00003c70  6f 73 72 64 63 68 3d 26  46 46 45 30 0d 20 20 20  |osrdch=&FFE0.   |
00003c80  34 30 20 6f 73 77 72 63  68 3d 26 46 46 45 45 0d  |40 oswrch=&FFEE.|
00003c90  20 20 20 35 30 20 6f 73  77 6f 72 64 3d 26 46 46  |   50 osword=&FF|
00003ca0  46 31 0d 20 20 20 36 30  20 46 4f 52 70 61 73 73  |F1.   60 FORpass|
00003cb0  3d 34 20 54 4f 20 36 20  53 54 45 50 20 32 0d 20  |=4 TO 6 STEP 2. |
00003cc0  20 20 37 30 20 4f 25 3d  6d 63 6f 64 65 0d 20 20  |  70 O%=mcode.  |
00003cd0  20 38 30 20 50 25 3d 70  61 67 65 0d 20 20 20 39  | 80 P%=page.   9|
00003ce0  30 20 5b 20 20 20 20 20  20 20 4f 50 54 20 70 61  |0 [       OPT pa|
00003cf0  73 73 0d 20 20 31 30 30  20 2e 66 69 72 73 74 62  |ss.  100 .firstb|
00003d00  79 74 65 0d 20 20 31 31  30 20 20 20 20 20 20 20  |yte.  110       |
00003d10  20 20 45 51 55 57 20 26  46 46 30 44 20 20 20 20  |  EQUW &FF0D    |
00003d20  5c 20 4e 45 57 20 74 68  65 20 42 41 53 49 43 20  |\ NEW the BASIC |
00003d30  70 72 6f 67 72 61 6d 0d  20 20 31 32 30 20 2e 73  |program.  120 .s|
00003d40  74 61 72 74 0d 20 20 31  33 30 20 20 20 20 20 20  |tart.  130      |
00003d50  20 20 20 4c 44 58 20 23  26 30 30 0d 20 20 31 34  |   LDX #&00.  14|
00003d60  30 20 2e 6c 6f 6f 70 0d  20 20 31 35 30 20 20 20  |0 .loop.  150   |
00003d70  20 20 20 20 20 20 4c 44  41 20 6d 65 73 73 61 67  |      LDA messag|
00003d80  65 2c 58 0d 20 20 31 36  30 20 20 20 20 20 20 20  |e,X.  160       |
00003d90  20 20 42 45 51 20 65 6e  64 0d 20 20 31 37 30 20  |  BEQ end.  170 |
00003da0  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 77 72  |        JSR oswr|
00003db0  63 68 0d 20 20 31 38 30  20 20 20 20 20 20 20 20  |ch.  180        |
00003dc0  20 49 4e 58 0d 20 20 31  39 30 20 20 20 20 20 20  | INX.  190      |
00003dd0  20 20 20 42 4e 45 20 6c  6f 6f 70 0d 20 20 32 30  |   BNE loop.  20|
00003de0  30 20 2e 65 6e 64 0d 20  20 32 31 30 20 20 20 20  |0 .end.  210    |
00003df0  20 20 20 20 20 4a 53 52  20 6f 73 72 64 63 68 0d  |     JSR osrdch.|
00003e00  20 20 32 32 30 20 20 20  20 20 20 20 20 20 42 43  |  220         BC|
00003e10  43 20 73 61 76 65 0d 20  20 32 33 30 20 20 20 20  |C save.  230    |
00003e20  20 20 20 20 20 42 52 4b  0d 20 20 32 34 30 20 20  |     BRK.  240  |
00003e30  20 20 20 20 20 20 20 42  52 4b 0d 20 20 32 35 30  |       BRK.  250|
00003e40  20 20 20 20 20 20 20 20  20 45 51 55 53 20 22 45  |         EQUS "E|
00003e50  73 63 61 70 65 22 0d 20  20 32 36 30 20 20 20 20  |scape".  260    |
00003e60  20 20 20 20 20 42 52 4b  0d 20 20 32 37 30 20 2e  |     BRK.  270 .|
00003e70  73 61 76 65 0d 20 20 32  38 30 20 20 20 20 20 20  |save.  280      |
00003e80  20 20 20 4c 44 41 20 23  26 37 46 0d 20 20 32 39  |   LDA #&7F.  29|
00003e90  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 62  |0         LDX #b|
00003ea0  6c 6f 63 6b 20 4d 4f 44  20 32 35 36 0d 20 20 33  |lock MOD 256.  3|
00003eb0  30 30 20 20 20 20 20 20  20 20 20 4c 44 59 20 23  |00         LDY #|
00003ec0  62 6c 6f 63 6b 20 44 49  56 20 32 35 36 0d 20 20  |block DIV 256.  |
00003ed0  33 31 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |310         JSR |
00003ee0  6f 73 77 6f 72 64 20 20  20 20 5c 20 77 72 69 74  |osword    \ writ|
00003ef0  65 20 64 65 6c 65 74 65  64 20 64 61 74 61 0d 20  |e deleted data. |
00003f00  20 33 32 30 20 20 20 20  20 20 20 20 20 4c 44 41  | 320         LDA|
00003f10  20 72 65 73 75 6c 74 20  20 20 20 5c 20 6c 6f 61  | result    \ loa|
00003f20  64 20 72 65 73 75 6c 74  20 62 79 74 65 0d 20 20  |d result byte.  |
00003f30  33 33 30 20 20 20 20 20  20 20 20 20 41 4e 44 20  |330         AND |
00003f40  23 26 31 45 20 20 20 20  20 20 5c 20 69 73 6f 6c  |#&1E      \ isol|
00003f50  61 74 65 20 65 72 72 6f  72 20 63 6f 64 65 0d 20  |ate error code. |
00003f60  20 33 34 30 20 20 20 20  20 20 20 20 20 42 4e 45  | 340         BNE|
00003f70  20 65 72 72 6f 72 0d 20  20 33 35 30 20 20 20 20  | error.  350    |
00003f80  20 20 20 20 20 42 52 4b  0d 20 20 33 36 30 20 20  |     BRK.  360  |
00003f90  20 20 20 20 20 20 20 42  52 4b 0d 20 20 33 37 30  |       BRK.  370|
00003fa0  20 20 20 20 20 20 20 20  20 45 51 55 53 20 22 57  |         EQUS "W|
00003fb0  72 69 74 65 20 4f 4b 22  0d 20 20 33 38 30 20 2e  |rite OK".  380 .|
00003fc0  65 72 72 6f 72 0d 20 20  33 39 30 20 20 20 20 20  |error.  390     |
00003fd0  20 20 20 20 42 52 4b 0d  20 20 34 30 30 20 20 20  |    BRK.  400   |
00003fe0  20 20 20 20 20 20 42 52  4b 0d 20 20 34 31 30 20  |      BRK.  410 |
00003ff0  20 20 20 20 20 20 20 20  45 51 55 53 20 22 57 72  |        EQUS "Wr|
00004000  69 74 65 20 66 61 69 6c  65 64 22 0d 20 20 34 32  |ite failed".  42|
00004010  30 20 20 20 20 20 20 20  20 20 42 52 4b 0d 20 20  |0         BRK.  |
00004020  34 33 30 20 2e 62 6c 6f  63 6b 0d 20 20 34 34 30  |430 .block.  440|
00004030  20 20 20 20 20 20 20 20  20 45 51 55 42 20 26 46  |         EQUB &F|
00004040  46 20 20 20 20 20 20 5c  20 63 75 72 72 65 6e 74  |F      \ current|
00004050  20 64 72 69 76 65 0d 20  20 34 35 30 20 20 20 20  | drive.  450    |
00004060  20 20 20 20 20 45 51 55  44 20 70 61 67 65 2b 26  |     EQUD page+&|
00004070  31 30 30 20 5c 20 73 74  61 72 74 20 61 74 20 50  |100 \ start at P|
00004080  41 47 45 2b 26 31 30 30  0d 20 20 34 36 30 20 20  |AGE+&100.  460  |
00004090  20 20 20 20 20 20 20 45  51 55 42 20 26 30 33 20  |       EQUB &03 |
000040a0  20 20 20 20 20 5c 20 33  20 70 61 72 61 6d 65 74  |     \ 3 paramet|
000040b0  65 72 73 0d 20 20 34 37  30 20 20 20 20 20 20 20  |ers.  470       |
000040c0  20 20 45 51 55 42 20 26  34 46 20 20 20 20 20 20  |  EQUB &4F      |
000040d0  5c 20 77 72 69 74 65 20  64 65 6c 65 74 65 64 20  |\ write deleted |
000040e0  6d 75 6c 74 69 2d 73 65  63 74 6f 72 0d 20 20 34  |multi-sector.  4|
000040f0  38 30 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |80         EQUB |
00004100  26 30 31 20 20 20 20 20  20 5c 20 6c 6f 67 69 63  |&01      \ logic|
00004110  61 6c 20 74 72 61 63 6b  20 26 30 31 0d 20 20 34  |al track &01.  4|
00004120  39 30 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |90         EQUB |
00004130  26 30 30 20 20 20 20 20  20 5c 20 73 74 61 72 74  |&00      \ start|
00004140  20 6c 6f 67 69 63 61 6c  20 73 65 63 74 6f 72 20  | logical sector |
00004150  26 30 30 0d 20 20 35 30  30 20 20 20 20 20 20 20  |&00.  500       |
00004160  20 20 45 51 55 42 20 26  34 32 20 20 20 20 20 20  |  EQUB &42      |
00004170  5c 20 32 20 73 65 63 74  6f 72 73 20 6f 66 20 35  |\ 2 sectors of 5|
00004180  31 32 20 62 79 74 65 73  0d 20 20 35 31 30 20 2e  |12 bytes.  510 .|
00004190  72 65 73 75 6c 74 0d 20  20 35 32 30 20 20 20 20  |result.  520    |
000041a0  20 20 20 20 20 45 51 55  42 20 26 30 30 20 20 20  |     EQUB &00   |
000041b0  20 20 20 5c 20 72 65 73  75 6c 74 20 62 79 74 65  |   \ result byte|
000041c0  0d 20 20 35 33 30 20 2e  6d 65 73 73 61 67 65 0d  |.  530 .message.|
000041d0  20 20 35 34 30 20 20 20  20 20 20 20 20 20 45 51  |  540         EQ|
000041e0  55 53 20 22 50 72 65 73  73 20 53 70 61 63 65 20  |US "Press Space |
000041f0  74 6f 20 73 61 76 65 20  64 61 74 61 20 6f 6e 20  |to save data on |
00004200  63 75 72 72 65 6e 74 20  64 69 73 63 22 0d 20 20  |current disc".  |
00004210  35 35 30 20 20 20 20 20  20 20 20 20 42 52 4b 0d  |550         BRK.|
00004220  20 20 35 36 30 20 2e 6c  61 73 74 62 79 74 65 0d  |  560 .lastbyte.|
00004230  20 20 35 37 30 20 5d 0d  20 20 35 38 30 20 4e 45  |  570 ].  580 NE|
00004240  58 54 0d 20 20 35 39 30  20 49 4e 50 55 54 27 22  |XT.  590 INPUT'"|
00004250  53 61 76 65 20 66 69 6c  65 6e 61 6d 65 20 3d 20  |Save filename = |
00004260  22 66 69 6c 65 6e 61 6d  65 24 0d 20 20 36 30 30  |"filename$.  600|
00004270  20 49 46 20 66 69 6c 65  6e 61 6d 65 24 20 3d 20  | IF filename$ = |
00004280  22 22 20 54 48 45 4e 20  45 4e 44 0d 20 20 36 31  |"" THEN END.  61|
00004290  30 20 2a 4f 50 54 31 2c  32 0d 20 20 36 32 30 20  |0 *OPT1,2.  620 |
000042a0  4f 53 43 4c 49 28 22 53  41 56 45 20 22 2b 66 69  |OSCLI("SAVE "+fi|
000042b0  6c 65 6e 61 6d 65 24 2b  22 20 22 2b 53 54 52 24  |lename$+" "+STR$|
000042c0  7e 28 6d 63 6f 64 65 29  2b 22 2b 22 2b 53 54 52  |~(mcode)+"+"+STR|
000042d0  24 7e 28 6c 61 73 0d 20  20 20 20 20 20 74 62 79  |$~(las.      tby|
000042e0  74 65 2d 66 69 72 73 74  62 79 74 65 29 2b 22 20  |te-firstbyte)+" |
000042f0  22 2b 53 54 52 24 7e 28  73 74 61 72 74 29 2b 22  |"+STR$~(start)+"|
00004300  20 22 2b 53 54 52 24 7e  28 66 69 72 73 74 62 79  | "+STR$~(firstby|
00004310  74 65 29 29 0d 20 20 36  33 30 20 2a 4f 50 54 31  |te)).  630 *OPT1|
00004320  2c 30 0d 20 20 36 34 30  20 45 4e 44 0d 0d 0d 54  |,0.  640 END...T|
00004330  68 65 20 64 61 74 61 20  73 74 6f 72 65 64 20 6f  |he data stored o|
00004340  6e 20 74 68 65 20 64 69  73 63 20 75 73 69 6e 67  |n the disc using|
00004350  20 53 41 56 45 35 20 63  61 6e 6e 6f 74 20 62 65  | SAVE5 cannot be|
00004360  20 72 65 61 64 20 62 61  63 6b 20 6f 66 66 20 74  | read back off t|
00004370  68 65 20 64 69 73 63 0d  75 73 69 6e 67 20 61 6e  |he disc.using an|
00004380  79 20 6f 66 20 74 68 65  20 44 46 53 20 73 74 61  |y of the DFS sta|
00004390  72 20 63 6f 6d 6d 61 6e  64 73 2e 20 54 68 65 20  |r commands. The |
000043a0  64 69 73 63 20 68 61 73  20 62 65 65 6e 20 66 6f  |disc has been fo|
000043b0  72 6d 61 74 74 65 64 20  73 6f 20 74 68 61 74 20  |rmatted so that |
000043c0  61 0d 21 42 4f 4f 54 20  66 69 6c 65 20 77 69 6c  |a.!BOOT file wil|
000043d0  6c 20 62 65 20 2a 52 55  4e 20 6f 6e 20 53 68 69  |l be *RUN on Shi|
000043e0  66 74 2b 42 72 65 61 6b  20 61 6e 64 20 73 6f 20  |ft+Break and so |
000043f0  74 68 65 20 64 75 6d 6d  79 20 21 42 4f 4f 54 20  |the dummy !BOOT |
00004400  66 69 6c 65 20 65 6e 74  65 72 65 64 0d 69 6e 74  |file entered.int|
00004410  6f 20 74 68 65 20 63 61  74 61 6c 6f 67 75 65 20  |o the catalogue |
00004420  62 79 20 74 68 65 20 66  6f 72 6d 61 74 74 69 6e  |by the formattin|
00004430  67 20 70 72 6f 67 72 61  6d 20 6e 65 65 64 73 20  |g program needs |
00004440  74 6f 20 62 65 20 72 65  70 6c 61 63 65 64 20 77  |to be replaced w|
00004450  69 74 68 20 61 0d 72 65  61 6c 20 21 42 4f 4f 54  |ith a.real !BOOT|
00004460  20 66 69 6c 65 20 77 68  69 63 68 20 77 69 6c 6c  | file which will|
00004470  20 6c 6f 61 64 20 61 6e  64 20 72 75 6e 20 74 68  | load and run th|
00004480  65 20 70 72 6f 67 72 61  6d 20 73 74 6f 72 65 64  |e program stored|
00004490  20 6f 6e 20 74 72 61 63  6b 20 26 30 31 2e 0d 0d  | on track &01...|
000044a0  54 68 65 20 70 72 6f 67  72 61 6d 20 44 45 43 4f  |The program DECO|
000044b0  44 45 20 77 69 6c 6c 20  70 72 6f 64 75 63 65 20  |DE will produce |
000044c0  61 6e 20 61 70 70 72 6f  70 72 69 61 74 65 20 6d  |an appropriate m|
000044d0  61 63 68 69 6e 65 20 63  6f 64 65 20 21 42 4f 4f  |achine code !BOO|
000044e0  54 20 66 69 6c 65 0d 77  68 69 63 68 20 73 69 6d  |T file.which sim|
000044f0  70 6c 79 20 72 65 76 65  72 73 65 73 20 74 68 65  |ply reverses the|
00004500  20 57 72 69 74 65 20 44  65 6c 65 74 65 64 20 44  | Write Deleted D|
00004510  61 74 61 20 6f 70 65 72  61 74 69 6f 6e 20 77 68  |ata operation wh|
00004520  69 63 68 20 70 75 74 20  74 68 65 20 64 61 74 61  |ich put the data|
00004530  0d 6f 6e 74 6f 20 74 68  65 20 64 69 73 63 2e 20  |.onto the disc. |
00004540  57 68 65 6e 20 74 68 65  20 64 65 6c 65 74 65 64  |When the deleted|
00004550  20 64 61 74 61 20 68 61  76 65 20 62 65 65 6e 20  | data have been |
00004560  72 65 6c 6f 61 64 65 64  20 69 6e 74 6f 20 6d 65  |reloaded into me|
00004570  6d 6f 72 79 20 74 68 65  0d 63 6f 6d 6d 61 6e 64  |mory the.command|
00004580  20 43 41 4c 4c 20 28 50  41 47 45 2b 26 31 30 32  | CALL (PAGE+&102|
00004590  29 20 3c 52 65 74 75 72  6e 3e 20 69 73 20 69 6e  |) <Return> is in|
000045a0  73 65 72 74 65 64 20 69  6e 74 6f 20 74 68 65 20  |serted into the |
000045b0  6b 65 79 62 6f 61 72 64  20 62 75 66 66 65 72 2c  |keyboard buffer,|
000045c0  0d 61 6e 64 20 42 41 53  49 43 20 69 73 20 65 6e  |.and BASIC is en|
000045d0  74 65 72 65 64 20 75 73  69 6e 67 20 4f 73 62 79  |tered using Osby|
000045e0  74 65 20 26 38 45 2e 20  54 68 65 20 56 44 55 20  |te &8E. The VDU |
000045f0  69 73 20 64 69 73 61 62  6c 65 64 20 62 65 66 6f  |is disabled befo|
00004600  72 65 0d 69 6e 73 65 72  74 69 6e 67 20 74 68 65  |re.inserting the|
00004610  20 64 61 74 61 20 69 6e  74 6f 20 74 68 65 20 6b  | data into the k|
00004620  65 79 62 6f 61 72 64 20  62 75 66 66 65 72 20 28  |eyboard buffer (|
00004630  6c 69 6e 65 73 20 34 36  30 2d 34 37 30 29 20 61  |lines 460-470) a|
00004640  6e 64 20 72 65 2d 65 6e  61 62 6c 65 64 0d 62 65  |nd re-enabled.be|
00004650  66 6f 72 65 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |fore the command|
00004660  20 69 73 20 65 78 65 63  75 74 65 64 20 28 6c 69  | is executed (li|
00004670  6e 65 20 36 31 30 29 2e  20 54 68 69 73 20 68 69  |ne 610). This hi|
00004680  64 65 73 20 77 68 61 74  20 79 6f 75 20 61 72 65  |des what you are|
00004690  20 64 6f 69 6e 67 0d 66  72 6f 6d 20 74 68 65 20  | doing.from the |
000046a0  64 69 73 63 20 75 73 65  72 2e 20 41 6e 79 20 63  |disc user. Any c|
000046b0  6f 6d 6d 61 6e 64 2c 20  6f 72 20 73 65 72 69 65  |ommand, or serie|
000046c0  73 20 6f 66 20 63 6f 6d  6d 61 6e 64 73 2c 20 63  |s of commands, c|
000046d0  61 6e 20 62 65 20 65 78  65 63 75 74 65 64 20 69  |an be executed i|
000046e0  6e 0d 74 68 69 73 20 77  61 79 20 73 6f 20 74 68  |n.this way so th|
000046f0  61 74 20 42 41 53 49 43  20 70 72 6f 67 72 61 6d  |at BASIC program|
00004700  73 20 61 73 20 77 65 6c  6c 20 61 73 20 6d 61 63  |s as well as mac|
00004710  68 69 6e 65 20 63 6f 64  65 20 70 72 6f 67 72 61  |hine code progra|
00004720  6d 73 20 63 61 6e 20 62  65 0d 73 74 6f 72 65 64  |ms can be.stored|
00004730  20 6f 6e 2c 20 61 6e 64  20 72 75 6e 20 66 72 6f  | on, and run fro|
00004740  6d 2c 20 74 68 65 20 63  6f 70 79 2d 70 72 6f 74  |m, the copy-prot|
00004750  65 63 74 65 64 20 64 69  73 63 2e 0d 0d 54 68 65  |ected disc...The|
00004760  20 6f 70 74 69 6f 6e 61  6c 20 63 6f 64 65 20 69  | optional code i|
00004770  6e 20 6c 69 6e 65 73 20  31 34 30 20 74 6f 20 32  |n lines 140 to 2|
00004780  33 30 20 6f 66 20 44 45  43 4f 44 45 20 63 61 6e  |30 of DECODE can|
00004790  20 62 65 20 75 73 65 64  20 74 6f 20 66 75 72 74  | be used to furt|
000047a0  68 65 72 0d 70 72 6f 74  65 63 74 20 79 6f 75 72  |her.protect your|
000047b0  20 73 6f 66 74 77 61 72  65 20 62 75 74 20 79 6f  | software but yo|
000047c0  75 20 73 68 6f 75 6c 64  20 73 74 61 72 74 20 74  |u should start t|
000047d0  6f 20 74 68 69 6e 6b 20  6f 66 20 79 6f 75 72 20  |o think of your |
000047e0  6f 77 6e 20 69 64 65 61  73 20 74 6f 0d 69 6e 63  |own ideas to.inc|
000047f0  6f 72 70 6f 72 61 74 65  20 77 69 74 68 20 74 68  |orporate with th|
00004800  65 73 65 20 74 65 63 68  6e 69 71 75 65 73 2e 20  |ese techniques. |
00004810  44 69 73 63 20 63 6f 70  79 2d 70 72 6f 74 65 63  |Disc copy-protec|
00004820  74 69 6f 6e 20 69 73 20  6f 6e 6c 79 20 75 73 65  |tion is only use|
00004830  66 75 6c 20 69 66 0d 69  74 20 69 73 20 75 6e 69  |ful if.it is uni|
00004840  71 75 65 20 61 6e 64 20  76 65 72 79 20 64 69 66  |que and very dif|
00004850  66 69 63 75 6c 74 20 74  6f 20 62 72 65 61 6b 2e  |ficult to break.|
00004860  20 54 68 65 73 65 20 70  72 6f 67 72 61 6d 73 20  | These programs |
00004870  61 72 65 20 6e 65 69 74  68 65 72 20 62 75 74 0d  |are neither but.|
00004880  74 68 65 79 20 61 72 65  20 61 20 67 6f 6f 64 20  |they are a good |
00004890  69 6e 74 72 6f 64 75 63  74 69 6f 6e 20 74 6f 20  |introduction to |
000048a0  74 68 65 20 6e 65 63 65  73 73 61 72 79 20 74 65  |the necessary te|
000048b0  63 68 6e 69 71 75 65 73  20 61 6e 64 20 74 68 65  |chniques and the|
000048c0  20 64 69 73 63 73 0d 74  68 65 79 20 70 72 6f 64  | discs.they prod|
000048d0  75 63 65 20 63 61 6e 6e  6f 74 20 62 65 20 64 75  |uce cannot be du|
000048e0  70 6c 69 63 61 74 65 64  20 77 69 74 68 20 74 68  |plicated with th|
000048f0  65 20 2a 42 41 43 4b 55  50 20 63 6f 6d 6d 61 6e  |e *BACKUP comman|
00004900  64 2e 0d 0d 0d 20 20 20  31 30 20 52 45 4d 3a 20  |d....   10 REM: |
00004910  44 45 43 4f 44 45 0d 20  20 20 32 30 20 70 61 67  |DECODE.   20 pag|
00004920  65 3d 50 41 47 45 0d 20  20 20 33 30 20 44 49 4d  |e=PAGE.   30 DIM|
00004930  20 6d 63 6f 64 65 20 26  31 30 30 0d 20 20 20 34  | mcode &100.   4|
00004940  30 20 6f 73 61 73 63 69  3d 26 46 46 45 33 0d 20  |0 osasci=&FFE3. |
00004950  20 20 35 30 20 6f 73 77  6f 72 64 3d 26 46 46 46  |  50 osword=&FFF|
00004960  31 0d 20 20 20 36 30 20  6f 73 62 79 74 65 3d 26  |1.   60 osbyte=&|
00004970  46 46 46 34 0d 20 20 20  37 30 20 46 4f 52 70 61  |FFF4.   70 FORpa|
00004980  73 73 3d 34 20 54 4f 20  36 20 53 54 45 50 20 32  |ss=4 TO 6 STEP 2|
00004990  0d 20 20 20 38 30 20 4f  25 3d 6d 63 6f 64 65 0d  |.   80 O%=mcode.|
000049a0  20 20 20 39 30 20 50 25  3d 70 61 67 65 0d 20 20  |   90 P%=page.  |
000049b0  31 30 30 20 5b 20 20 20  20 20 20 20 4f 50 54 20  |100 [       OPT |
000049c0  70 61 73 73 0d 20 20 31  31 30 20 2e 66 69 72 73  |pass.  110 .firs|
000049d0  74 62 79 74 65 0d 20 20  31 32 30 20 20 20 20 20  |tbyte.  120     |
000049e0  20 20 20 20 45 51 55 57  20 26 46 46 30 44 20 20  |    EQUW &FF0D  |
000049f0  20 20 5c 20 4e 45 57 20  74 68 65 20 42 41 53 49  |  \ NEW the BASI|
00004a00  43 20 70 72 6f 67 72 61  6d 0d 20 20 31 33 30 20  |C program.  130 |
00004a10  2e 73 74 61 72 74 0d 20  20 31 34 30 20 20 20 20  |.start.  140    |
00004a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004a30  20 20 20 5c 20 4c 44 41  20 23 26 43 38 20 5c 20  |   \ LDA #&C8 \ |
00004a40  77 72 69 74 65 20 42 72  65 61 6b 20 65 66 66 65  |write Break effe|
00004a50  63 74 0d 20 20 31 35 30  20 20 20 20 20 20 20 20  |ct.  150        |
00004a60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00004a70  20 4c 44 58 20 23 26 30  32 20 5c 20 63 6c 65 61  | LDX #&02 \ clea|
00004a80  72 20 6d 65 6d 6f 72 79  20 6f 6e 20 42 72 65 61  |r memory on Brea|
00004a90  6b 0d 20 20 31 36 30 20  20 20 20 20 20 20 20 20  |k.  160         |
00004aa0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00004ab0  4c 44 59 20 23 26 30 30  0d 20 20 31 37 30 20 20  |LDY #&00.  170  |
00004ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004ad0  20 20 20 20 20 5c 20 4a  53 52 20 6f 73 62 79 74  |     \ JSR osbyt|
00004ae0  65 0d 20 20 31 38 30 20  20 20 20 20 20 20 20 20  |e.  180         |
00004af0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00004b00  4c 44 41 20 23 26 34 43  20 5c 20 4a 4d 50 20 6f  |LDA #&4C \ JMP o|
00004b10  70 63 6f 64 65 0d 20 20  31 39 30 20 20 20 20 20  |pcode.  190     |
00004b20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004b30  20 20 5c 20 4c 44 58 20  23 26 38 37 20 5c 20 4a  |  \ LDX #&87 \ J|
00004b40  4d 50 20 26 32 38 37 20  67 69 76 65 73 20 61 6e  |MP &287 gives an|
00004b50  0d 20 20 32 30 30 20 20  20 20 20 20 20 20 20 20  |.  200          |
00004b60  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 4c  |             \ L|
00004b70  44 59 20 23 26 30 32 20  5c 20 65 6e 64 6c 65 73  |DY #&02 \ endles|
00004b80  73 20 6c 6f 6f 70 20 6f  6e 20 42 72 65 61 6b 0d  |s loop on Break.|
00004b90  20 20 32 31 30 20 20 20  20 20 20 20 20 20 20 20  |  210           |
00004ba0  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 53 54  |            \ ST|
00004bb0  41 20 26 32 38 37 0d 20  20 32 32 30 20 20 20 20  |A &287.  220    |
00004bc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004bd0  20 20 20 5c 20 53 54 58  20 26 32 38 38 0d 20 20  |   \ STX &288.  |
00004be0  32 33 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |230             |
00004bf0  20 20 20 20 20 20 20 20  20 20 5c 20 53 54 59 20  |          \ STY |
00004c00  26 32 38 39 0d 20 20 32  34 30 20 20 20 20 20 20  |&289.  240      |
00004c10  20 20 20 4c 44 41 20 23  26 37 46 0d 20 20 32 35  |   LDA #&7F.  25|
00004c20  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 62  |0         LDX #b|
00004c30  6c 6f 63 6b 20 4d 4f 44  20 32 35 36 0d 20 20 32  |lock MOD 256.  2|
00004c40  36 30 20 20 20 20 20 20  20 20 20 4c 44 59 20 23  |60         LDY #|
00004c50  62 6c 6f 63 6b 20 44 49  56 20 32 35 36 0d 20 20  |block DIV 256.  |
00004c60  32 37 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |270         JSR |
00004c70  6f 73 77 6f 72 64 20 20  20 20 5c 20 72 65 61 64  |osword    \ read|
00004c80  20 64 65 6c 65 74 65 64  20 64 61 74 61 0d 20 20  | deleted data.  |
00004c90  32 38 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |280         LDA |
00004ca0  72 65 73 75 6c 74 20 20  20 20 5c 20 6c 6f 61 64  |result    \ load|
00004cb0  20 72 65 73 75 6c 74 20  62 79 74 65 0d 20 20 32  | result byte.  2|
00004cc0  39 30 20 20 20 20 20 20  20 20 20 41 4e 44 20 23  |90         AND #|
00004cd0  26 31 45 20 20 20 20 20  20 5c 20 69 73 6f 6c 61  |&1E      \ isola|
00004ce0  74 65 20 65 72 72 6f 72  20 63 6f 64 65 0d 20 20  |te error code.  |
00004cf0  33 30 30 20 20 20 20 20  20 20 20 20 42 4e 45 20  |300         BNE |
00004d00  65 72 72 6f 72 0d 20 20  33 31 30 20 20 20 20 20  |error.  310     |
00004d10  20 20 20 20 4c 44 41 20  23 26 46 46 20 20 20 20  |    LDA #&FF    |
00004d20  20 20 5c 20 69 6e 69 74  69 61 6c 69 73 65 20 6f  |  \ initialise o|
00004d30  66 66 73 65 74 0d 20 20  33 32 30 20 20 20 20 20  |ffset.  320     |
00004d40  20 20 20 20 50 48 41 20  20 20 20 20 20 20 20 20  |    PHA         |
00004d50  20 20 5c 20 73 61 76 65  20 6f 66 66 73 65 74 0d  |  \ save offset.|
00004d60  20 20 33 33 30 20 2e 70  75 6c 6c 0d 20 20 33 34  |  330 .pull.  34|
00004d70  30 20 20 20 20 20 20 20  20 20 50 4c 41 0d 20 20  |0         PLA.  |
00004d80  33 35 30 20 20 20 20 20  20 20 20 20 54 41 58 0d  |350         TAX.|
00004d90  20 20 33 36 30 20 20 20  20 20 20 20 20 20 49 4e  |  360         IN|
00004da0  58 20 20 20 20 20 20 20  20 20 20 20 5c 20 69 6e  |X           \ in|
00004db0  63 72 65 6d 65 6e 74 20  6f 66 66 73 65 74 0d 20  |crement offset. |
00004dc0  20 33 37 30 20 20 20 20  20 20 20 20 20 54 58 41  | 370         TXA|
00004dd0  0d 20 20 33 38 30 20 20  20 20 20 20 20 20 20 50  |.  380         P|
00004de0  48 41 20 20 20 20 20 20  20 20 20 20 20 5c 20 73  |HA           \ s|
00004df0  74 6f 72 65 20 63 75 72  72 65 6e 74 20 6f 66 66  |tore current off|
00004e00  73 65 74 0d 20 20 33 39  30 20 20 20 20 20 20 20  |set.  390       |
00004e10  20 20 4c 44 59 20 6b 65  79 62 6f 61 72 64 2c 58  |  LDY keyboard,X|
00004e20  20 5c 20 6c 6f 61 64 20  62 79 74 65 20 66 6f 72  | \ load byte for|
00004e30  20 6b 65 79 62 6f 61 72  64 20 62 75 66 66 65 72  | keyboard buffer|
00004e40  0d 20 20 34 30 30 20 20  20 20 20 20 20 20 20 42  |.  400         B|
00004e50  45 51 20 63 6f 6e 74 69  6e 75 65 20 20 5c 20 62  |EQ continue  \ b|
00004e60  72 61 6e 63 68 20 69 66  20 66 69 6e 69 73 68 65  |ranch if finishe|
00004e70  64 0d 20 20 34 31 30 20  20 20 20 20 20 20 20 20  |d.  410         |
00004e80  4c 44 58 20 23 30 0d 20  20 34 32 30 20 20 20 20  |LDX #0.  420    |
00004e90  20 20 20 20 20 4c 44 41  20 23 26 38 41 0d 20 20  |     LDA #&8A.  |
00004ea0  34 33 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |430         JSR |
00004eb0  6f 73 62 79 74 65 20 20  20 20 5c 20 70 75 74 20  |osbyte    \ put |
00004ec0  62 79 74 65 20 69 6e 74  6f 20 6b 65 79 62 6f 61  |byte into keyboa|
00004ed0  72 64 20 62 75 66 66 65  72 0d 20 20 34 34 30 20  |rd buffer.  440 |
00004ee0  20 20 20 20 20 20 20 20  4a 4d 50 20 70 75 6c 6c  |        JMP pull|
00004ef0  0d 20 20 34 35 30 20 2e  63 6f 6e 74 69 6e 75 65  |.  450 .continue|
00004f00  0d 20 20 34 36 30 20 20  20 20 20 20 20 20 20 4c  |.  460         L|
00004f10  44 41 20 23 26 31 35 0d  20 20 34 37 30 20 20 20  |DA #&15.  470   |
00004f20  20 20 20 20 20 20 4a 53  52 20 6f 73 61 73 63 69  |      JSR osasci|
00004f30  20 20 20 20 5c 20 64 69  73 61 62 6c 65 20 56 44  |    \ disable VD|
00004f40  55 0d 20 20 34 38 30 20  20 20 20 20 20 20 20 20  |U.  480         |
00004f50  4c 44 41 20 23 26 42 42  0d 20 20 34 39 30 20 20  |LDA #&BB.  490  |
00004f60  20 20 20 20 20 20 20 4c  44 58 20 23 30 0d 20 20  |       LDX #0.  |
00004f70  35 30 30 20 20 20 20 20  20 20 20 20 4c 44 59 20  |500         LDY |
00004f80  23 26 46 46 0d 20 20 35  31 30 20 20 20 20 20 20  |#&FF.  510      |
00004f90  20 20 20 4a 53 52 20 6f  73 62 79 74 65 20 20 20  |   JSR osbyte   |
00004fa0  20 5c 20 66 69 6e 64 20  42 41 53 49 43 0d 20 20  | \ find BASIC.  |
00004fb0  35 32 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |520         LDA |
00004fc0  23 26 38 45 0d 20 20 35  33 30 20 20 20 20 20 20  |#&8E.  530      |
00004fd0  20 20 20 4a 4d 50 20 6f  73 62 79 74 65 20 20 20  |   JMP osbyte   |
00004fe0  20 5c 20 73 65 6c 65 63  74 20 42 41 53 49 43 20  | \ select BASIC |
00004ff0  6e 6f 20 72 65 74 75 72  6e 0d 20 20 35 34 30 20  |no return.  540 |
00005000  2e 65 72 72 6f 72 0d 20  20 35 35 30 20 20 20 20  |.error.  550    |
00005010  20 20 20 20 20 42 52 4b  0d 20 20 35 36 30 20 20  |     BRK.  560  |
00005020  20 20 20 20 20 20 20 42  52 4b 0d 20 20 35 37 30  |       BRK.  570|
00005030  20 20 20 20 20 20 20 20  20 45 51 55 53 20 22 44  |         EQUS "D|
00005040  69 73 63 20 72 65 61 64  20 65 72 72 6f 72 22 0d  |isc read error".|
00005050  20 20 35 38 30 20 20 20  20 20 20 20 20 20 42 52  |  580         BR|
00005060  4b 0d 20 20 35 39 30 20  2e 6b 65 79 62 6f 61 72  |K.  590 .keyboar|
00005070  64 0d 20 20 36 30 30 20  20 20 20 20 20 20 20 20  |d.  600         |
00005080  45 51 55 53 20 22 43 41  4c 4c 20 26 22 2b 53 54  |EQUS "CALL &"+ST|
00005090  52 24 7e 28 70 61 67 65  2b 26 31 30 32 29 0d 20  |R$~(page+&102). |
000050a0  20 36 31 30 20 20 20 20  20 20 20 20 20 45 51 55  | 610         EQU|
000050b0  42 20 26 30 36 20 20 20  20 20 20 5c 20 65 6e 61  |B &06      \ ena|
000050c0  62 6c 65 20 56 44 55 0d  20 20 36 32 30 20 20 20  |ble VDU.  620   |
000050d0  20 20 20 20 20 20 45 51  55 42 20 26 30 44 0d 20  |      EQUB &0D. |
000050e0  20 36 33 30 20 20 20 20  20 20 20 20 20 42 52 4b  | 630         BRK|
000050f0  0d 20 20 36 34 30 20 2e  62 6c 6f 63 6b 0d 20 20  |.  640 .block.  |
00005100  36 35 30 20 20 20 20 20  20 20 20 20 45 51 55 42  |650         EQUB|
00005110  20 26 46 46 20 20 20 20  20 20 5c 20 63 75 72 72  | &FF      \ curr|
00005120  65 6e 74 20 64 72 69 76  65 0d 20 20 36 36 30 20  |ent drive.  660 |
00005130  20 20 20 20 20 20 20 20  45 51 55 44 20 70 61 67  |        EQUD pag|
00005140  65 2b 26 31 30 30 20 5c  20 73 74 61 72 74 20 61  |e+&100 \ start a|
00005150  74 20 50 41 47 45 2b 26  31 30 30 0d 20 20 36 37  |t PAGE+&100.  67|
00005160  30 20 20 20 20 20 20 20  20 20 45 51 55 42 20 26  |0         EQUB &|
00005170  30 33 20 20 20 20 20 20  5c 20 33 20 70 61 72 61  |03      \ 3 para|
00005180  6d 65 74 65 72 73 0d 20  20 36 38 30 20 20 20 20  |meters.  680    |
00005190  20 20 20 20 20 45 51 55  42 20 26 35 37 20 20 20  |     EQUB &57   |
000051a0  20 20 20 5c 20 72 65 61  64 20 64 65 6c 65 74 65  |   \ read delete|
000051b0  64 20 6d 75 6c 74 69 2d  73 65 63 74 6f 72 0d 20  |d multi-sector. |
000051c0  20 36 39 30 20 20 20 20  20 20 20 20 20 45 51 55  | 690         EQU|
000051d0  42 20 26 30 31 20 20 20  20 20 20 5c 20 6c 6f 67  |B &01      \ log|
000051e0  69 63 61 6c 20 74 72 61  63 6b 20 26 30 31 0d 20  |ical track &01. |
000051f0  20 37 30 30 20 20 20 20  20 20 20 20 20 45 51 55  | 700         EQU|
00005200  42 20 26 30 30 20 20 20  20 20 20 5c 20 73 74 61  |B &00      \ sta|
00005210  72 74 20 6c 6f 67 69 63  61 6c 20 73 65 63 74 6f  |rt logical secto|
00005220  72 20 30 0d 20 20 37 31  30 20 20 20 20 20 20 20  |r 0.  710       |
00005230  20 20 45 51 55 42 20 26  34 32 20 20 20 20 20 20  |  EQUB &42      |
00005240  5c 20 32 20 73 65 63 74  6f 72 73 20 6f 66 20 35  |\ 2 sectors of 5|
00005250  31 32 20 62 79 74 65 73  0d 20 20 37 32 30 20 2e  |12 bytes.  720 .|
00005260  72 65 73 75 6c 74 0d 20  20 37 33 30 20 20 20 20  |result.  730    |
00005270  20 20 20 20 20 45 51 55  42 20 26 30 30 20 20 20  |     EQUB &00   |
00005280  20 20 20 5c 20 72 65 73  75 6c 74 20 62 79 74 65  |   \ result byte|
00005290  0d 20 20 37 34 30 20 2e  6c 61 73 74 62 79 74 65  |.  740 .lastbyte|
000052a0  0d 20 20 37 35 30 20 5d  0d 20 20 37 36 30 20 4e  |.  750 ].  760 N|
000052b0  45 58 54 0d 20 20 37 37  30 20 50 52 49 4e 54 27  |EXT.  770 PRINT'|
000052c0  22 50 72 65 73 73 20 53  70 61 63 65 20 74 6f 20  |"Press Space to |
000052d0  73 61 76 65 20 21 42 4f  4f 54 20 66 69 6c 65 22  |save !BOOT file"|
000052e0  0d 20 20 37 38 30 20 52  45 50 45 41 54 0d 20 20  |.  780 REPEAT.  |
000052f0  37 39 30 20 55 4e 54 49  4c 20 47 45 54 3d 33 32  |790 UNTIL GET=32|
00005300  0d 20 20 38 30 30 20 2a  4f 50 54 31 2c 32 0d 20  |.  800 *OPT1,2. |
00005310  20 38 31 30 20 4f 53 43  4c 49 28 22 53 41 56 45  | 810 OSCLI("SAVE|
00005320  20 24 2e 21 42 4f 4f 54  20 22 2b 53 54 52 24 7e  | $.!BOOT "+STR$~|
00005330  28 6d 63 6f 64 65 29 2b  22 2b 22 2b 53 54 52 24  |(mcode)+"+"+STR$|
00005340  7e 28 6c 61 73 74 62 79  74 65 2d 0d 20 20 20 20  |~(lastbyte-.    |
00005350  20 20 66 69 72 73 74 62  79 74 65 29 2b 22 20 22  |  firstbyte)+" "|
00005360  2b 53 54 52 24 7e 28 73  74 61 72 74 29 2b 22 20  |+STR$~(start)+" |
00005370  22 2b 53 54 52 24 7e 28  66 69 72 73 74 62 79 74  |"+STR$~(firstbyt|
00005380  65 29 29 0d 20 20 38 32  30 20 2a 4f 50 54 31 2c  |e)).  820 *OPT1,|
00005390  30 0d                                             |0.|
00005392
18-09-88/T\DFS06.m0
18-09-88/T\DFS06.m1
18-09-88/T\DFS06.m2
18-09-88/T\DFS06.m4
18-09-88/T\DFS06.m5