Home » CEEFAX disks » telesoftware5.adl » 22-01-88/T\SWR13

22-01-88/T\SWR13

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 » telesoftware5.adl
Filename: 22-01-88/T\SWR13
Read OK:
File size: 4FBF bytes
Load address: 0000
Exec address: FFFFFFFF
Duplicates

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

File contents
Mastering Sideways ROM & RAM - Module 13 - Trapping errors
----------------------------------------------------------

  In module 8 you were shown how to deal with user-generated errors
created within your own sideways ram programs. Errors can also be
generated in other sideways roms and it is possible to trap these
errors and process them within your rom image. This is not an easy
task but it can produce some useful and impressive software.

  Errors generated in SWR service code are dealt with by copying an
error message, preceded and followed by a BRK instruction, into the
error buffer and then jumping to the BRK instruction preceding the
error message. When the BRK instruction is executed, the MOS issues
service call 6 to all the sideways roms before handing over the error
to the current language. Errors generated in other, lower priority,
roms can be trapped in your SWR program by intercepting service call
6. Ideally your program should be in socket &0F.

  The MOS issues service call 6 with the error number pointer (in
locations &FD and &FE) containing the address of the byte after the
BRK instruction and location &F0 containing the value of the stack
pointer after the BRK was executed. Osbyte &BA can be used to find the
number of the rom which was active when the BRK was executed.

  There are 2 ways of processing errors after trapping them in your
sideways ram program:

1. Your routine can completely replace the error handler which would
normally deal with the error.

2. Your routine can perform a function or print a message before
handing the error back to the current language's error handling
routine.

  In this module I will show you how to design a sideways ram program
to completely replace the normal error handling of the DFS "Cat full"
and "Disc full" errors. The program will be used to copy all the files
from a disc in drive 0 onto as many drive 1 discs as are necessary to
hold them all. This might seem a trivial task but consider what would
happen if drive 0 has a full 80 track disc and drive 1 is a 40 track
drive. Using *COPY 0 1 *.* will eventually create the disc full error
and stop transfering the files before they have all been copied. Using
the same command will create a cat full error if the disc in drive 1
has only one or two catalogue entries unused.

  The program FILES instructs the command line interpreter to *COPY
all the files from drive 0 to drive 1. If an error is generated the
program intercepts service call 6 and tests the address stored in the
error number pointer to see if either the cat full or disc full error
has been generated. If it finds either it instructs the user to change
the disc in drive 1 and then continues with the save operation that
generated the error. When all the files have been transfered from
drive 0 to drive 1 the program re-enters BASIC to clear any error
condition that might exist.

  After explaining how to design this type of program I will show how
it can be modified to pass control back to the normal error handling
routine.

  If you intend to write a program which traps errors by intercepting
service call 6 you need to know the error number of the error you
intend to trap. You can either look the error number up in a manual or
deliberately create the error and then look at a memory dump of the
error buffer and find the error number from there. Figure 13.1 is a
memory dump of the error buffer after creating a cat full and a disc
full error. The error number of each error is stored in the byte after
the first BRK instruction, ie. in location &101. The cat full error
number is &BE and the disc full error number is &C6.



0100  00 BE 43 61 74 20 66 75  ..Cat fu
0108  6C 6C 00 00 00 00 00 00  ll......
0110  00 00 00 00 00 00 00 00  ........

0100  00 C6 44 69 73 6B 20 66  ..Disk f
0108  75 6C 6C 00 00 00 00 00  ull.....
0110  00 00 00 00 00 00 00 00  ........

Figure 13.1  The error buffer after Cat full and Disc full errors.
-----------  -----------------------------------------------------



  To trap either of these two errors it is necessary for the SWR
interpreter to intercept service call 6 and test the content of the
memory location stored in the error number pointer to see if it
contains either &BE or &C6. If either of these numbers is found the
new error handling routine can process the error, if neither is found
the registers must be restored and control passed back to the MOS.

  The purpose of the program is to copy all the files from a disc in
drive 0 onto a disc in drive 1. To do this the program will store data
concerned with the task in its private workspace. The data stored in
private workspace includes a flag which indicates whether or not the
utility is active. If the utility is active the interpreter can trap
and process the cat full and disc full errors. If it is not active the
interpreter must not trap them.

  The routine in figure 13.2 is taken from FILES and tests a flag set
up in the last byte of the first page of private workspace. This byte
stores &FF if the utility is active and &00 if it is not. Control will
only pass to the new error handler if the utility is active and if
either the cat full or disc full error has been generated. The flag is
set up when the private workspace is claimed and switched on and off
when the utility starts and finishes.



         PHA
         CMP #6           \ is it service call 6?
         BNE out          \ branch if not
         TXA              \ store all registers
         PHA
         TYA
         PHA
         LDX &F4          \ load this rom number
         LDA &DF0,X       \ find start of workspace
         STA &73          \ store high byte of start of workspace
         LDA #0           \ workspace always starts at page boundary
         STA &72          \ low byte of start of workspace
         LDY #&FF         \ flag address offset
         LDA (&72),Y      \ load flag
         BEQ noton        \ branch if utility not active
         INY              \ Y=0
         LDA (&FD),Y      \ load errror number
         CMP #&BE         \ Cat full error number
         BEQ change       \ branch if Cat full error
         CMP #&C6         \ Disc full error number
         BEQ change       \ branch if Disc full error
.noton
         PLA              \ restore all registers
         TAY
         PLA
         TAX
.out
         PLA
         RTS
.change

Figure 13.2  Checking the utility active flag.
-----------  ---------------------------------


  As well as a utility active flag there is quite a lot of other data
stored in private workspace. The entire catalogue of drive 0 is stored
and workspace is needed for a command line interpreter buffer and an
Osword parameter block. The program needs to claim two pages of
private workspace to store all these data.

  Figure 13.3 is a memory dump of three parts of the two pages of
private workspace claimed by the program FILES. The memory dump was
made while the program FILES was transfering the first file from drive
0 to drive 1. It shows how the private workspace is used by the
program. In the computer in which the memory dump was made, the
private workspace claimed by FILES was in pages &17 and &18. It could
be in any two consecutive pages depending on the workspace claimed by
other roms and the priority of the program FILES.




1700  43 4F 50 59 20 30 20 31  COPY 0 1
1708  20 24 2E 54 52 41 43 45   $.TRACE
1710  20 20 0D 00 00 00 00 00    ......

1780  00 00 18 FF FF 03 53 00  ......S.
1788  00 21 00 00 00 00 00 00  .!......

17F8  00 00 00 00 00 00 00 FF  ........
1800  53 57 52 20 53 4F 46 54  SWR SOFT
1808  54 52 41 43 45 20 20 24  TRACE  $
1810  4F 53 57 4F 52 44 20 24  OSWORD $
1818  4F 53 42 59 54 45 20 24  OSBYTE $
1820  4F 53 57 44 45 4D 4F 24  OSWDEMO$

Figure 13.3  Parts of a memory dump of private workspace.
-----------  --------------------------------------------



  The drive 0 catalogue is read using Osword &7F and stored in the
second page of the private workspace (page &18 in this case). The
Osword parameter block starts at &1780. The contents of this buffer
(figure 13.3) indicate a successful read data multi sector from drive
0, track 0, sector 0 with data stored at &FFFF1800. 

  The command line interpreter buffer starts at &1700. The program
transfers all the files by copying each filename from the drive 0
catalogue (in page &18) into this buffer and then calling the command
line interpreter.

  The utility active flag is at &17FF. The contents of this flag in
figure 13.2 indicate that the utility was active when the memory dump
was made.

  There are a number of pointers set up in zero page to store the
addresses of the various locations indirectly addressed in the private
workspace. The absolute addresses will depend on the other roms in the
computer but in the computer used to generate figure 13.3 they had the
values shown in figure 13.4.




Name       high byte low byte  Function
--------------------------------------------------------------------
directory  &17       &09      The directory of the current file
private    &17       &00      The start of private workspace
catbuff    &18       &08      The address of the first filename
clibuff    &17       &0B      The first byte of the current filename
block      &17       &80      The Osword parameter block

Figure 13.4  The zero page pointers.
-----------  -----------------------



  The SWR interpreter intercepts service call 2 to claim two pages of
private workspace and set up the utility active flag to indicate that
the utility is not yet active (lines 420-570).

  The one-command interpreter (lines 1050-1270) is used to recognise
the command *FILES and control is passed to the label ".found" (line
1280). The program is designed to trap errors generated in another rom
and for this reason the stack is balanced before doing anything else
(lines 1290-1310). Errors generated outside your control can play
havoc with the stack and balancing it at this stage minimises the
problems that can be created. The program checks that the DFS is
active (lines 1320-1370) and if all is well prints a "Copy all files -
Go?" message (lines 1500-1520). If the user types a "Y" contol is
passed to the label ".yes" (line 1630).

  The zero page pointers (figure 13.4) are set up (lines 1640-1810)
and the utility active flag is set to indicate that errors &BE and &C6
should be trapped (lines 1820-1840). The Osword parameter block
contents are copied into the Osword buffer (lines 1850-1910) and the
most significant byte of the address of the catalogue buffer is also
stored in the Osword buffer (lines 1920-1940). The first part of the
*COPY command is transfered into the command line interpreter buffer
(lines 1950-2010) and the least significant byte of the address of the
first file in the drive 0 catalogue is stored in the zero page pointer
to the command line interpreter buffer (line 2020). The drive 0
catalogue is read and stored in the second page of the private
workspace (lines 2030-2060).

  The files are transfered, one at a time, from drive 0 to drive 1.
(lines 2070-2320). Up to 31 files will be copied but if either the cat
full or disc full errors is generated by the DFS the interpreter will
trap the error (lines 610-800) and pass control to the label ".change"
(line 890). The stack is pulled six times to balance it. The stack has
the registers from the SWR interpreter as well as the status register
and return address pushed on when the DFS BRK was executed. These can
all be discarded. The program prompts the user to change the disc in
drive 1 (lines 960-1030) and then returns control to the loop
transfering the files (line 1040 and line 2270).

  When all the files have been transfered from drive 0 to drive 1, the
program clears the utility active flag (lines 2340-2360), flushes all
the buffers (lines 2380-2400), finds BASIC (lines 2410-2440) and
enters BASIC (lines 2450-2460) which clears all error conditions.

  To modify FILES to pass control back to the normal error handling
routine delete lines 930-950 and 2410-2460. Type the new line 2410.

  2410 LDA #0:RTS

The program will perform the same function but report the Disc full or
Cat full error message at the end of the file transfers.

  You could also modify the program to use pages &09 and &0A instead
of private workspace. This would make the program shorter and not
raise Oshwm and PAGE but, if you use these pages instead of private
workspace, you can not be sure that your workspace will remain
uncorrupted (see Module 11).




   10 REM: FILES
   20 MODE7
   30 HIMEM=&3C00
   40 DIM save 50
   50 diff=&8000-HIMEM
   60 directory=&70
   70 private=directory+2
   80 catbuff=directory+4
   90 clibuff=directory+6
  100 block=directory+8
  110 address=directory+10
  120 comvec=&F2
  130 romnumber=&F4
  140 errornum=&FD
  150 errstack=&100
  160 workspace=&DF0
  170 osargs=&FFDA
  180 osrdch=&FFE0
  190 osasci=&FFE3
  200 osnewl=&FFE7
  210 osword=&FFF1
  220 osbyte=&FFF4
  230 oscli=&FFF7
  240 FOR pass = 0 TO 2 STEP 2
  250 P%=HIMEM
  260 [       OPT pass
  270         BRK
  280         BRK
  290         BRK
  300         JMP service+diff
  310         OPT FNequb(&82)
  320         OPT FNequb((copyright+diff) MOD 256)
  330         BRK
  340 .title
  350         OPT FNequs("FILES")
  360 .copyright
  370         BRK
  380         OPT FNequs("(C) Gordon Horsington 1987")
  390         BRK
  400 .service
  410         PHA
  420         CMP #2
  430         BNE tryfour
  440         TYA
  450         PHA
  460         STA workspace,X
  470         LDA #0
  480         STA private
  490         STY private+1
  500         LDY #&FF
  510         STA (private),Y \ 0 = utility off
  520         PLA
  530         TAY
  540         INY           \ 2 pages of
  550         INY           \ private workspace
  560         PLA
  570         RTS
  580 .tryfour
  590         CMP #4
  600         BEQ unrecognised
  610         CMP #6
  620         BNE out
  630         TXA
  640         PHA
  650         TYA
  660         PHA
  670         LDX romnumber
  680         LDA workspace,X
  690         STA private+1
  700         LDA #0
  710         STA private
  720         LDY #&FF
  730         LDA (private),Y
  740         BEQ noton
  750         INY
  760         LDA (errornum),Y
  770         CMP #&BE      \ Cat full
  780         BEQ change
  790         CMP #&C6      \ Disc full
  800         BEQ change
  810 .noton
  820         PLA
  830         TAY
  840         PLA
  850         TAX
  860 .out
  870         PLA
  880         RTS
  890 .change
  900         PLA           \ Y
  910         PLA           \ X
  920         PLA           \ A
  930         PLA           \ Status register
  940         PLA           \ Return
  950         PLA           \ address
  960         LDX #(swapdisc+diff) MOD 256
  970         LDY #(swapdisc+diff) DIV 256
  980         JSR print+diff
  990 .spacebar
 1000         LDA #&7A
 1010         JSR osbyte    \ Scan keyboard
 1020         CPX #&62
 1030         BNE spacebar  \ Wait for Space
 1040         JMP another+diff
 1050 .unrecognised
 1060         TXA
 1070         PHA
 1080         TYA
 1090         PHA
 1100         LDX #&FF
 1110 .comloop
 1120         INX
 1130         LDA title+diff,X
 1140         BEQ found
 1150         LDA (comvec),Y
 1160         INY
 1170         CMP #ASC(".")
 1180         BEQ found
 1190         AND #&DF
 1200         CMP title+diff,X
 1210         BEQ comloop
 1220         PLA
 1230         TAY
 1240         PLA
 1250         TAX
 1260         PLA
 1270         RTS
 1280 .found
 1290         PLA
 1300         PLA
 1310         PLA
 1320         LDA #0
 1330         TAX
 1340         TAY
 1350         JSR osargs
 1360         CMP #4        \ Is DFS active?
 1370         BEQ dfs
 1380         LDA #(wrong+diff) MOD 256
 1390         STA address
 1400         LDA #(wrong+diff) DIV 256
 1410         STA address+1
 1420         LDY #&FF
 1430 .errorloop
 1440         INY
 1450         LDA (address),Y
 1460         STA errstack,Y
 1470         BPL errorloop
 1480         JMP errstack
 1490 .dfs
 1500         LDX #(go+diff) MOD 256
 1510         LDY #(go+diff) DIV 256
 1520         JSR print+diff
 1530         JSR osrdch
 1540         AND #&DF
 1550         PHA
 1560         JSR osasci
 1570         JSR osnewl
 1580         PLA
 1590         CMP #ASC("Y")
 1600         BEQ yes
 1610         LDA #0
 1620         RTS
 1630 .yes
 1640         JSR osnewl
 1650         LDX romnumber
 1660         LDA workspace,X
 1670         STA block+1
 1680         STA clibuff+1
 1690         STA private+1
 1700         STA directory+1
 1710         CLC
 1720         ADC #1
 1730         STA catbuff+1
 1740         LDA #&80
 1750         STA block
 1760         LDY #8
 1770         STY catbuff
 1780         INY
 1790         STY directory
 1800         LDA #0
 1810         STA private
 1820         LDA #&FF
 1830         TAY
 1840         STA (private),Y \ &FF = utility on
 1850         INY           \ Y=0
 1860 .dataloop
 1870         LDA data+diff,Y
 1880         STA (block),Y
 1890         INY
 1900         CPY #&A
 1910         BCC dataloop
 1920         LDY #2
 1930         LDA catbuff+1
 1940         STA (block),Y
 1950         LDY #0
 1960 .copyloop
 1970         LDA copy+diff,Y
 1980         STA (private),Y
 1990         INY
 2000         CPY #&B
 2010         BCC copyloop
 2020         STY clibuff
 2030         LDA #&7F
 2040         LDX block
 2050         LDY block+1
 2060         JSR osword    \ Read catalogue
 2070 .catalogue
 2080         LDY #0
 2090 .transfer
 2100         LDA (catbuff),Y
 2110         STA (clibuff),Y
 2120         INY
 2130         CPY #7
 2140         BCC transfer
 2150         LDA #&D
 2160         STA (clibuff),Y
 2170         LDA (catbuff),Y
 2180         AND #&7F
 2190         CMP #ASC(" ")
 2200         BCC finish
 2210         LDY #0
 2220         STA (directory),Y
 2230         LDA catbuff
 2240         CLC
 2250         ADC #8
 2260         STA catbuff
 2270 .another
 2280         LDX #0
 2290         LDY clibuff+1
 2300         JSR oscli
 2310         LDA catbuff
 2320         BNE catalogue
 2330 .finish
 2340         LDA #0
 2350         LDY #&FF
 2360         STA (private),Y \ 0 = utility off
 2370         JSR osnewl
 2380         LDA #&F
 2390         LDX #0
 2400         JSR osbyte    \ Flush buffers
 2410         LDA #&BB
 2420         LDX #0
 2430         LDY #&FF
 2440         JSR osbyte    \ Find BASIC
 2450         LDA #&8E
 2460         JMP osbyte    \ Enter BASIC
 2470 .print
 2480         STX address
 2490         STY address+1
 2500         LDA #&F
 2510         LDX #0
 2520         JSR osbyte    \ Flush buffers
 2530         LDY #0
 2540 .printloop
 2550         LDA (address),Y
 2560         BEQ endprint
 2570         JSR osasci
 2580         INY
 2590         JMP printloop+diff
 2600 .endprint
 2610         RTS
 2620 .data
 2630         OPT FNequd(&FF000000)
 2640         OPT FNequd(&005303FF)
 2650         OPT FNequw(&2100)
 2660 .copy
 2670         OPT FNequs("COPY 0 1 *.")
 2680 .swapdisc
 2690         OPT FNequw(&070D)
 2700         OPT FNequs("Insert a new disc in ")
 2710         OPT FNequb(&3A)
 2720         OPT FNequs("1")
 2730         OPT FNequb(&0D)
 2740         OPT FNequs("and press the Space Bar")
 2750         OPT FNequw(&0D0D)
 2760         BRK
 2770 .go
 2780         OPT FNequs("Copy all files from ")
 2790         OPT FNequb(&3A)
 2800         OPT FNequs("0 to ")
 2810         OPT FNequb(&3A)
 2820         OPT FNequs("1")
 2830         OPT FNequb(&0D)
 2840         OPT FNequs("Go (Y/N) ? ")
 2850         BRK
 2860 .wrong
 2870         BRK
 2880         BRK
 2890         OPT FNequs("DFS not active")
 2900         BRK
 2910         OPT FNequb(&FF)
 2920 .lastbyte
 2930 ]
 2940 NEXT
 2950 INPUT'"Save filename = "filename$
 2960 IF filename$="" END
 2970 $save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(las
      tbyte)+" FFFF8000 FFFF8000"
 2980 X%=save MOD 256
 2990 Y%=save DIV 256
 3000 *OPT1,2
 3010 CALL oscli
 3020 *OPT1,0
 3030 END
 3040 DEFFNequb(byte)
 3050 ?P%=byte
 3060 P%=P%+1
 3070 =pass
 3080 DEFFNequw(word)
 3090 ?P%=word MOD 256
 3100 P%?1=word DIV 256
 3110 P%=P%+2
 3120 =pass
 3130 DEFFNequd(double)
 3140 !P%=double
 3150 P%=P%+4
 3160 =pass
 3170 DEFFNequs(string$)
 3180 $P%=string$
 3190 P%=P%+LEN(string$)
 3200 =pass
00000000  4d 61 73 74 65 72 69 6e  67 20 53 69 64 65 77 61  |Mastering Sidewa|
00000010  79 73 20 52 4f 4d 20 26  20 52 41 4d 20 2d 20 4d  |ys ROM & RAM - M|
00000020  6f 64 75 6c 65 20 31 33  20 2d 20 54 72 61 70 70  |odule 13 - Trapp|
00000030  69 6e 67 20 65 72 72 6f  72 73 0d 2d 2d 2d 2d 2d  |ing errors.-----|
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 20  20 49 6e 20 6d 6f 64 75  |-----..  In modu|
00000080  6c 65 20 38 20 79 6f 75  20 77 65 72 65 20 73 68  |le 8 you were sh|
00000090  6f 77 6e 20 68 6f 77 20  74 6f 20 64 65 61 6c 20  |own how to deal |
000000a0  77 69 74 68 20 75 73 65  72 2d 67 65 6e 65 72 61  |with user-genera|
000000b0  74 65 64 20 65 72 72 6f  72 73 0d 63 72 65 61 74  |ted errors.creat|
000000c0  65 64 20 77 69 74 68 69  6e 20 79 6f 75 72 20 6f  |ed within your o|
000000d0  77 6e 20 73 69 64 65 77  61 79 73 20 72 61 6d 20  |wn sideways ram |
000000e0  70 72 6f 67 72 61 6d 73  2e 20 45 72 72 6f 72 73  |programs. Errors|
000000f0  20 63 61 6e 20 61 6c 73  6f 20 62 65 0d 67 65 6e  | can also be.gen|
00000100  65 72 61 74 65 64 20 69  6e 20 6f 74 68 65 72 20  |erated in other |
00000110  73 69 64 65 77 61 79 73  20 72 6f 6d 73 20 61 6e  |sideways roms an|
00000120  64 20 69 74 20 69 73 20  70 6f 73 73 69 62 6c 65  |d it is possible|
00000130  20 74 6f 20 74 72 61 70  20 74 68 65 73 65 0d 65  | to trap these.e|
00000140  72 72 6f 72 73 20 61 6e  64 20 70 72 6f 63 65 73  |rrors and proces|
00000150  73 20 74 68 65 6d 20 77  69 74 68 69 6e 20 79 6f  |s them within yo|
00000160  75 72 20 72 6f 6d 20 69  6d 61 67 65 2e 20 54 68  |ur rom image. Th|
00000170  69 73 20 69 73 20 6e 6f  74 20 61 6e 20 65 61 73  |is is not an eas|
00000180  79 0d 74 61 73 6b 20 62  75 74 20 69 74 20 63 61  |y.task but it ca|
00000190  6e 20 70 72 6f 64 75 63  65 20 73 6f 6d 65 20 75  |n produce some u|
000001a0  73 65 66 75 6c 20 61 6e  64 20 69 6d 70 72 65 73  |seful and impres|
000001b0  73 69 76 65 20 73 6f 66  74 77 61 72 65 2e 0d 0d  |sive software...|
000001c0  20 20 45 72 72 6f 72 73  20 67 65 6e 65 72 61 74  |  Errors generat|
000001d0  65 64 20 69 6e 20 53 57  52 20 73 65 72 76 69 63  |ed in SWR servic|
000001e0  65 20 63 6f 64 65 20 61  72 65 20 64 65 61 6c 74  |e code are dealt|
000001f0  20 77 69 74 68 20 62 79  20 63 6f 70 79 69 6e 67  | with by copying|
00000200  20 61 6e 0d 65 72 72 6f  72 20 6d 65 73 73 61 67  | an.error messag|
00000210  65 2c 20 70 72 65 63 65  64 65 64 20 61 6e 64 20  |e, preceded and |
00000220  66 6f 6c 6c 6f 77 65 64  20 62 79 20 61 20 42 52  |followed by a BR|
00000230  4b 20 69 6e 73 74 72 75  63 74 69 6f 6e 2c 20 69  |K instruction, i|
00000240  6e 74 6f 20 74 68 65 0d  65 72 72 6f 72 20 62 75  |nto the.error bu|
00000250  66 66 65 72 20 61 6e 64  20 74 68 65 6e 20 6a 75  |ffer and then ju|
00000260  6d 70 69 6e 67 20 74 6f  20 74 68 65 20 42 52 4b  |mping to the BRK|
00000270  20 69 6e 73 74 72 75 63  74 69 6f 6e 20 70 72 65  | instruction pre|
00000280  63 65 64 69 6e 67 20 74  68 65 0d 65 72 72 6f 72  |ceding the.error|
00000290  20 6d 65 73 73 61 67 65  2e 20 57 68 65 6e 20 74  | message. When t|
000002a0  68 65 20 42 52 4b 20 69  6e 73 74 72 75 63 74 69  |he BRK instructi|
000002b0  6f 6e 20 69 73 20 65 78  65 63 75 74 65 64 2c 20  |on is executed, |
000002c0  74 68 65 20 4d 4f 53 20  69 73 73 75 65 73 0d 73  |the MOS issues.s|
000002d0  65 72 76 69 63 65 20 63  61 6c 6c 20 36 20 74 6f  |ervice call 6 to|
000002e0  20 61 6c 6c 20 74 68 65  20 73 69 64 65 77 61 79  | all the sideway|
000002f0  73 20 72 6f 6d 73 20 62  65 66 6f 72 65 20 68 61  |s roms before ha|
00000300  6e 64 69 6e 67 20 6f 76  65 72 20 74 68 65 20 65  |nding over the e|
00000310  72 72 6f 72 0d 74 6f 20  74 68 65 20 63 75 72 72  |rror.to the curr|
00000320  65 6e 74 20 6c 61 6e 67  75 61 67 65 2e 20 45 72  |ent language. Er|
00000330  72 6f 72 73 20 67 65 6e  65 72 61 74 65 64 20 69  |rors generated i|
00000340  6e 20 6f 74 68 65 72 2c  20 6c 6f 77 65 72 20 70  |n other, lower p|
00000350  72 69 6f 72 69 74 79 2c  0d 72 6f 6d 73 20 63 61  |riority,.roms ca|
00000360  6e 20 62 65 20 74 72 61  70 70 65 64 20 69 6e 20  |n be trapped in |
00000370  79 6f 75 72 20 53 57 52  20 70 72 6f 67 72 61 6d  |your SWR program|
00000380  20 62 79 20 69 6e 74 65  72 63 65 70 74 69 6e 67  | by intercepting|
00000390  20 73 65 72 76 69 63 65  20 63 61 6c 6c 0d 36 2e  | service call.6.|
000003a0  20 49 64 65 61 6c 6c 79  20 79 6f 75 72 20 70 72  | Ideally your pr|
000003b0  6f 67 72 61 6d 20 73 68  6f 75 6c 64 20 62 65 20  |ogram should be |
000003c0  69 6e 20 73 6f 63 6b 65  74 20 26 30 46 2e 0d 0d  |in socket &0F...|
000003d0  20 20 54 68 65 20 4d 4f  53 20 69 73 73 75 65 73  |  The MOS issues|
000003e0  20 73 65 72 76 69 63 65  20 63 61 6c 6c 20 36 20  | service call 6 |
000003f0  77 69 74 68 20 74 68 65  20 65 72 72 6f 72 20 6e  |with the error n|
00000400  75 6d 62 65 72 20 70 6f  69 6e 74 65 72 20 28 69  |umber pointer (i|
00000410  6e 0d 6c 6f 63 61 74 69  6f 6e 73 20 26 46 44 20  |n.locations &FD |
00000420  61 6e 64 20 26 46 45 29  20 63 6f 6e 74 61 69 6e  |and &FE) contain|
00000430  69 6e 67 20 74 68 65 20  61 64 64 72 65 73 73 20  |ing the address |
00000440  6f 66 20 74 68 65 20 62  79 74 65 20 61 66 74 65  |of the byte afte|
00000450  72 20 74 68 65 0d 42 52  4b 20 69 6e 73 74 72 75  |r the.BRK instru|
00000460  63 74 69 6f 6e 20 61 6e  64 20 6c 6f 63 61 74 69  |ction and locati|
00000470  6f 6e 20 26 46 30 20 63  6f 6e 74 61 69 6e 69 6e  |on &F0 containin|
00000480  67 20 74 68 65 20 76 61  6c 75 65 20 6f 66 20 74  |g the value of t|
00000490  68 65 20 73 74 61 63 6b  0d 70 6f 69 6e 74 65 72  |he stack.pointer|
000004a0  20 61 66 74 65 72 20 74  68 65 20 42 52 4b 20 77  | after the BRK w|
000004b0  61 73 20 65 78 65 63 75  74 65 64 2e 20 4f 73 62  |as executed. Osb|
000004c0  79 74 65 20 26 42 41 20  63 61 6e 20 62 65 20 75  |yte &BA can be u|
000004d0  73 65 64 20 74 6f 20 66  69 6e 64 20 74 68 65 0d  |sed to find the.|
000004e0  6e 75 6d 62 65 72 20 6f  66 20 74 68 65 20 72 6f  |number of the ro|
000004f0  6d 20 77 68 69 63 68 20  77 61 73 20 61 63 74 69  |m which was acti|
00000500  76 65 20 77 68 65 6e 20  74 68 65 20 42 52 4b 20  |ve when the BRK |
00000510  77 61 73 20 65 78 65 63  75 74 65 64 2e 0d 0d 20  |was executed... |
00000520  20 54 68 65 72 65 20 61  72 65 20 32 20 77 61 79  | There are 2 way|
00000530  73 20 6f 66 20 70 72 6f  63 65 73 73 69 6e 67 20  |s of processing |
00000540  65 72 72 6f 72 73 20 61  66 74 65 72 20 74 72 61  |errors after tra|
00000550  70 70 69 6e 67 20 74 68  65 6d 20 69 6e 20 79 6f  |pping them in yo|
00000560  75 72 0d 73 69 64 65 77  61 79 73 20 72 61 6d 20  |ur.sideways ram |
00000570  70 72 6f 67 72 61 6d 3a  0d 0d 31 2e 20 59 6f 75  |program:..1. You|
00000580  72 20 72 6f 75 74 69 6e  65 20 63 61 6e 20 63 6f  |r routine can co|
00000590  6d 70 6c 65 74 65 6c 79  20 72 65 70 6c 61 63 65  |mpletely replace|
000005a0  20 74 68 65 20 65 72 72  6f 72 20 68 61 6e 64 6c  | the error handl|
000005b0  65 72 20 77 68 69 63 68  20 77 6f 75 6c 64 0d 6e  |er which would.n|
000005c0  6f 72 6d 61 6c 6c 79 20  64 65 61 6c 20 77 69 74  |ormally deal wit|
000005d0  68 20 74 68 65 20 65 72  72 6f 72 2e 0d 0d 32 2e  |h the error...2.|
000005e0  20 59 6f 75 72 20 72 6f  75 74 69 6e 65 20 63 61  | Your routine ca|
000005f0  6e 20 70 65 72 66 6f 72  6d 20 61 20 66 75 6e 63  |n perform a func|
00000600  74 69 6f 6e 20 6f 72 20  70 72 69 6e 74 20 61 20  |tion or print a |
00000610  6d 65 73 73 61 67 65 20  62 65 66 6f 72 65 0d 68  |message before.h|
00000620  61 6e 64 69 6e 67 20 74  68 65 20 65 72 72 6f 72  |anding the error|
00000630  20 62 61 63 6b 20 74 6f  20 74 68 65 20 63 75 72  | back to the cur|
00000640  72 65 6e 74 20 6c 61 6e  67 75 61 67 65 27 73 20  |rent language's |
00000650  65 72 72 6f 72 20 68 61  6e 64 6c 69 6e 67 0d 72  |error handling.r|
00000660  6f 75 74 69 6e 65 2e 0d  0d 20 20 49 6e 20 74 68  |outine...  In th|
00000670  69 73 20 6d 6f 64 75 6c  65 20 49 20 77 69 6c 6c  |is module I will|
00000680  20 73 68 6f 77 20 79 6f  75 20 68 6f 77 20 74 6f  | show you how to|
00000690  20 64 65 73 69 67 6e 20  61 20 73 69 64 65 77 61  | design a sidewa|
000006a0  79 73 20 72 61 6d 20 70  72 6f 67 72 61 6d 0d 74  |ys ram program.t|
000006b0  6f 20 63 6f 6d 70 6c 65  74 65 6c 79 20 72 65 70  |o completely rep|
000006c0  6c 61 63 65 20 74 68 65  20 6e 6f 72 6d 61 6c 20  |lace the normal |
000006d0  65 72 72 6f 72 20 68 61  6e 64 6c 69 6e 67 20 6f  |error handling o|
000006e0  66 20 74 68 65 20 44 46  53 20 22 43 61 74 20 66  |f the DFS "Cat f|
000006f0  75 6c 6c 22 0d 61 6e 64  20 22 44 69 73 63 20 66  |ull".and "Disc f|
00000700  75 6c 6c 22 20 65 72 72  6f 72 73 2e 20 54 68 65  |ull" errors. The|
00000710  20 70 72 6f 67 72 61 6d  20 77 69 6c 6c 20 62 65  | program will be|
00000720  20 75 73 65 64 20 74 6f  20 63 6f 70 79 20 61 6c  | used to copy al|
00000730  6c 20 74 68 65 20 66 69  6c 65 73 0d 66 72 6f 6d  |l the files.from|
00000740  20 61 20 64 69 73 63 20  69 6e 20 64 72 69 76 65  | a disc in drive|
00000750  20 30 20 6f 6e 74 6f 20  61 73 20 6d 61 6e 79 20  | 0 onto as many |
00000760  64 72 69 76 65 20 31 20  64 69 73 63 73 20 61 73  |drive 1 discs as|
00000770  20 61 72 65 20 6e 65 63  65 73 73 61 72 79 20 74  | are necessary t|
00000780  6f 0d 68 6f 6c 64 20 74  68 65 6d 20 61 6c 6c 2e  |o.hold them all.|
00000790  20 54 68 69 73 20 6d 69  67 68 74 20 73 65 65 6d  | This might seem|
000007a0  20 61 20 74 72 69 76 69  61 6c 20 74 61 73 6b 20  | a trivial task |
000007b0  62 75 74 20 63 6f 6e 73  69 64 65 72 20 77 68 61  |but consider wha|
000007c0  74 20 77 6f 75 6c 64 0d  68 61 70 70 65 6e 20 69  |t would.happen i|
000007d0  66 20 64 72 69 76 65 20  30 20 68 61 73 20 61 20  |f drive 0 has a |
000007e0  66 75 6c 6c 20 38 30 20  74 72 61 63 6b 20 64 69  |full 80 track di|
000007f0  73 63 20 61 6e 64 20 64  72 69 76 65 20 31 20 69  |sc and drive 1 i|
00000800  73 20 61 20 34 30 20 74  72 61 63 6b 0d 64 72 69  |s a 40 track.dri|
00000810  76 65 2e 20 55 73 69 6e  67 20 2a 43 4f 50 59 20  |ve. Using *COPY |
00000820  30 20 31 20 2a 2e 2a 20  77 69 6c 6c 20 65 76 65  |0 1 *.* will eve|
00000830  6e 74 75 61 6c 6c 79 20  63 72 65 61 74 65 20 74  |ntually create t|
00000840  68 65 20 64 69 73 63 20  66 75 6c 6c 20 65 72 72  |he disc full err|
00000850  6f 72 0d 61 6e 64 20 73  74 6f 70 20 74 72 61 6e  |or.and stop tran|
00000860  73 66 65 72 69 6e 67 20  74 68 65 20 66 69 6c 65  |sfering the file|
00000870  73 20 62 65 66 6f 72 65  20 74 68 65 79 20 68 61  |s before they ha|
00000880  76 65 20 61 6c 6c 20 62  65 65 6e 20 63 6f 70 69  |ve all been copi|
00000890  65 64 2e 20 55 73 69 6e  67 0d 74 68 65 20 73 61  |ed. Using.the sa|
000008a0  6d 65 20 63 6f 6d 6d 61  6e 64 20 77 69 6c 6c 20  |me command will |
000008b0  63 72 65 61 74 65 20 61  20 63 61 74 20 66 75 6c  |create a cat ful|
000008c0  6c 20 65 72 72 6f 72 20  69 66 20 74 68 65 20 64  |l error if the d|
000008d0  69 73 63 20 69 6e 20 64  72 69 76 65 20 31 0d 68  |isc in drive 1.h|
000008e0  61 73 20 6f 6e 6c 79 20  6f 6e 65 20 6f 72 20 74  |as only one or t|
000008f0  77 6f 20 63 61 74 61 6c  6f 67 75 65 20 65 6e 74  |wo catalogue ent|
00000900  72 69 65 73 20 75 6e 75  73 65 64 2e 0d 0d 20 20  |ries unused...  |
00000910  54 68 65 20 70 72 6f 67  72 61 6d 20 46 49 4c 45  |The program FILE|
00000920  53 20 69 6e 73 74 72 75  63 74 73 20 74 68 65 20  |S instructs the |
00000930  63 6f 6d 6d 61 6e 64 20  6c 69 6e 65 20 69 6e 74  |command line int|
00000940  65 72 70 72 65 74 65 72  20 74 6f 20 2a 43 4f 50  |erpreter to *COP|
00000950  59 0d 61 6c 6c 20 74 68  65 20 66 69 6c 65 73 20  |Y.all the files |
00000960  66 72 6f 6d 20 64 72 69  76 65 20 30 20 74 6f 20  |from drive 0 to |
00000970  64 72 69 76 65 20 31 2e  20 49 66 20 61 6e 20 65  |drive 1. If an e|
00000980  72 72 6f 72 20 69 73 20  67 65 6e 65 72 61 74 65  |rror is generate|
00000990  64 20 74 68 65 0d 70 72  6f 67 72 61 6d 20 69 6e  |d the.program in|
000009a0  74 65 72 63 65 70 74 73  20 73 65 72 76 69 63 65  |tercepts service|
000009b0  20 63 61 6c 6c 20 36 20  61 6e 64 20 74 65 73 74  | call 6 and test|
000009c0  73 20 74 68 65 20 61 64  64 72 65 73 73 20 73 74  |s the address st|
000009d0  6f 72 65 64 20 69 6e 20  74 68 65 0d 65 72 72 6f  |ored in the.erro|
000009e0  72 20 6e 75 6d 62 65 72  20 70 6f 69 6e 74 65 72  |r number pointer|
000009f0  20 74 6f 20 73 65 65 20  69 66 20 65 69 74 68 65  | to see if eithe|
00000a00  72 20 74 68 65 20 63 61  74 20 66 75 6c 6c 20 6f  |r the cat full o|
00000a10  72 20 64 69 73 63 20 66  75 6c 6c 20 65 72 72 6f  |r disc full erro|
00000a20  72 0d 68 61 73 20 62 65  65 6e 20 67 65 6e 65 72  |r.has been gener|
00000a30  61 74 65 64 2e 20 49 66  20 69 74 20 66 69 6e 64  |ated. If it find|
00000a40  73 20 65 69 74 68 65 72  20 69 74 20 69 6e 73 74  |s either it inst|
00000a50  72 75 63 74 73 20 74 68  65 20 75 73 65 72 20 74  |ructs the user t|
00000a60  6f 20 63 68 61 6e 67 65  0d 74 68 65 20 64 69 73  |o change.the dis|
00000a70  63 20 69 6e 20 64 72 69  76 65 20 31 20 61 6e 64  |c in drive 1 and|
00000a80  20 74 68 65 6e 20 63 6f  6e 74 69 6e 75 65 73 20  | then continues |
00000a90  77 69 74 68 20 74 68 65  20 73 61 76 65 20 6f 70  |with the save op|
00000aa0  65 72 61 74 69 6f 6e 20  74 68 61 74 0d 67 65 6e  |eration that.gen|
00000ab0  65 72 61 74 65 64 20 74  68 65 20 65 72 72 6f 72  |erated the error|
00000ac0  2e 20 57 68 65 6e 20 61  6c 6c 20 74 68 65 20 66  |. When all the f|
00000ad0  69 6c 65 73 20 68 61 76  65 20 62 65 65 6e 20 74  |iles have been t|
00000ae0  72 61 6e 73 66 65 72 65  64 20 66 72 6f 6d 0d 64  |ransfered from.d|
00000af0  72 69 76 65 20 30 20 74  6f 20 64 72 69 76 65 20  |rive 0 to drive |
00000b00  31 20 74 68 65 20 70 72  6f 67 72 61 6d 20 72 65  |1 the program re|
00000b10  2d 65 6e 74 65 72 73 20  42 41 53 49 43 20 74 6f  |-enters BASIC to|
00000b20  20 63 6c 65 61 72 20 61  6e 79 20 65 72 72 6f 72  | clear any error|
00000b30  0d 63 6f 6e 64 69 74 69  6f 6e 20 74 68 61 74 20  |.condition that |
00000b40  6d 69 67 68 74 20 65 78  69 73 74 2e 0d 0d 20 20  |might exist...  |
00000b50  41 66 74 65 72 20 65 78  70 6c 61 69 6e 69 6e 67  |After explaining|
00000b60  20 68 6f 77 20 74 6f 20  64 65 73 69 67 6e 20 74  | how to design t|
00000b70  68 69 73 20 74 79 70 65  20 6f 66 20 70 72 6f 67  |his type of prog|
00000b80  72 61 6d 20 49 20 77 69  6c 6c 20 73 68 6f 77 20  |ram I will show |
00000b90  68 6f 77 0d 69 74 20 63  61 6e 20 62 65 20 6d 6f  |how.it can be mo|
00000ba0  64 69 66 69 65 64 20 74  6f 20 70 61 73 73 20 63  |dified to pass c|
00000bb0  6f 6e 74 72 6f 6c 20 62  61 63 6b 20 74 6f 20 74  |ontrol back to t|
00000bc0  68 65 20 6e 6f 72 6d 61  6c 20 65 72 72 6f 72 20  |he normal error |
00000bd0  68 61 6e 64 6c 69 6e 67  0d 72 6f 75 74 69 6e 65  |handling.routine|
00000be0  2e 0d 0d 20 20 49 66 20  79 6f 75 20 69 6e 74 65  |...  If you inte|
00000bf0  6e 64 20 74 6f 20 77 72  69 74 65 20 61 20 70 72  |nd to write a pr|
00000c00  6f 67 72 61 6d 20 77 68  69 63 68 20 74 72 61 70  |ogram which trap|
00000c10  73 20 65 72 72 6f 72 73  20 62 79 20 69 6e 74 65  |s errors by inte|
00000c20  72 63 65 70 74 69 6e 67  0d 73 65 72 76 69 63 65  |rcepting.service|
00000c30  20 63 61 6c 6c 20 36 20  79 6f 75 20 6e 65 65 64  | call 6 you need|
00000c40  20 74 6f 20 6b 6e 6f 77  20 74 68 65 20 65 72 72  | to know the err|
00000c50  6f 72 20 6e 75 6d 62 65  72 20 6f 66 20 74 68 65  |or number of the|
00000c60  20 65 72 72 6f 72 20 79  6f 75 0d 69 6e 74 65 6e  | error you.inten|
00000c70  64 20 74 6f 20 74 72 61  70 2e 20 59 6f 75 20 63  |d to trap. You c|
00000c80  61 6e 20 65 69 74 68 65  72 20 6c 6f 6f 6b 20 74  |an either look t|
00000c90  68 65 20 65 72 72 6f 72  20 6e 75 6d 62 65 72 20  |he error number |
00000ca0  75 70 20 69 6e 20 61 20  6d 61 6e 75 61 6c 20 6f  |up in a manual o|
00000cb0  72 0d 64 65 6c 69 62 65  72 61 74 65 6c 79 20 63  |r.deliberately c|
00000cc0  72 65 61 74 65 20 74 68  65 20 65 72 72 6f 72 20  |reate the error |
00000cd0  61 6e 64 20 74 68 65 6e  20 6c 6f 6f 6b 20 61 74  |and then look at|
00000ce0  20 61 20 6d 65 6d 6f 72  79 20 64 75 6d 70 20 6f  | a memory dump o|
00000cf0  66 20 74 68 65 0d 65 72  72 6f 72 20 62 75 66 66  |f the.error buff|
00000d00  65 72 20 61 6e 64 20 66  69 6e 64 20 74 68 65 20  |er and find the |
00000d10  65 72 72 6f 72 20 6e 75  6d 62 65 72 20 66 72 6f  |error number fro|
00000d20  6d 20 74 68 65 72 65 2e  20 46 69 67 75 72 65 20  |m there. Figure |
00000d30  31 33 2e 31 20 69 73 20  61 0d 6d 65 6d 6f 72 79  |13.1 is a.memory|
00000d40  20 64 75 6d 70 20 6f 66  20 74 68 65 20 65 72 72  | dump of the err|
00000d50  6f 72 20 62 75 66 66 65  72 20 61 66 74 65 72 20  |or buffer after |
00000d60  63 72 65 61 74 69 6e 67  20 61 20 63 61 74 20 66  |creating a cat f|
00000d70  75 6c 6c 20 61 6e 64 20  61 20 64 69 73 63 0d 66  |ull and a disc.f|
00000d80  75 6c 6c 20 65 72 72 6f  72 2e 20 54 68 65 20 65  |ull error. The e|
00000d90  72 72 6f 72 20 6e 75 6d  62 65 72 20 6f 66 20 65  |rror number of e|
00000da0  61 63 68 20 65 72 72 6f  72 20 69 73 20 73 74 6f  |ach error is sto|
00000db0  72 65 64 20 69 6e 20 74  68 65 20 62 79 74 65 20  |red in the byte |
00000dc0  61 66 74 65 72 0d 74 68  65 20 66 69 72 73 74 20  |after.the first |
00000dd0  42 52 4b 20 69 6e 73 74  72 75 63 74 69 6f 6e 2c  |BRK instruction,|
00000de0  20 69 65 2e 20 69 6e 20  6c 6f 63 61 74 69 6f 6e  | ie. in location|
00000df0  20 26 31 30 31 2e 20 54  68 65 20 63 61 74 20 66  | &101. The cat f|
00000e00  75 6c 6c 20 65 72 72 6f  72 0d 6e 75 6d 62 65 72  |ull error.number|
00000e10  20 69 73 20 26 42 45 20  61 6e 64 20 74 68 65 20  | is &BE and the |
00000e20  64 69 73 63 20 66 75 6c  6c 20 65 72 72 6f 72 20  |disc full error |
00000e30  6e 75 6d 62 65 72 20 69  73 20 26 43 36 2e 0d 0d  |number is &C6...|
00000e40  0d 0d 30 31 30 30 20 20  30 30 20 42 45 20 34 33  |..0100  00 BE 43|
00000e50  20 36 31 20 37 34 20 32  30 20 36 36 20 37 35 20  | 61 74 20 66 75 |
00000e60  20 2e 2e 43 61 74 20 66  75 0d 30 31 30 38 20 20  | ..Cat fu.0108  |
00000e70  36 43 20 36 43 20 30 30  20 30 30 20 30 30 20 30  |6C 6C 00 00 00 0|
00000e80  30 20 30 30 20 30 30 20  20 6c 6c 2e 2e 2e 2e 2e  |0 00 00  ll.....|
00000e90  2e 0d 30 31 31 30 20 20  30 30 20 30 30 20 30 30  |..0110  00 00 00|
00000ea0  20 30 30 20 30 30 20 30  30 20 30 30 20 30 30 20  | 00 00 00 00 00 |
00000eb0  20 2e 2e 2e 2e 2e 2e 2e  2e 0d 0d 30 31 30 30 20  | ..........0100 |
00000ec0  20 30 30 20 43 36 20 34  34 20 36 39 20 37 33 20  | 00 C6 44 69 73 |
00000ed0  36 42 20 32 30 20 36 36  20 20 2e 2e 44 69 73 6b  |6B 20 66  ..Disk|
00000ee0  20 66 0d 30 31 30 38 20  20 37 35 20 36 43 20 36  | f.0108  75 6C 6|
00000ef0  43 20 30 30 20 30 30 20  30 30 20 30 30 20 30 30  |C 00 00 00 00 00|
00000f00  20 20 75 6c 6c 2e 2e 2e  2e 2e 0d 30 31 31 30 20  |  ull......0110 |
00000f10  20 30 30 20 30 30 20 30  30 20 30 30 20 30 30 20  | 00 00 00 00 00 |
00000f20  30 30 20 30 30 20 30 30  20 20 2e 2e 2e 2e 2e 2e  |00 00 00  ......|
00000f30  2e 2e 0d 0d 46 69 67 75  72 65 20 31 33 2e 31 20  |....Figure 13.1 |
00000f40  20 54 68 65 20 65 72 72  6f 72 20 62 75 66 66 65  | The error buffe|
00000f50  72 20 61 66 74 65 72 20  43 61 74 20 66 75 6c 6c  |r after Cat full|
00000f60  20 61 6e 64 20 44 69 73  63 20 66 75 6c 6c 20 65  | and Disc full e|
00000f70  72 72 6f 72 73 2e 0d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |rrors..---------|
00000f80  2d 2d 20 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |--  ------------|
00000f90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000fb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0d 0d 0d 20 20 54  |---------....  T|
00000fc0  6f 20 74 72 61 70 20 65  69 74 68 65 72 20 6f 66  |o trap either of|
00000fd0  20 74 68 65 73 65 20 74  77 6f 20 65 72 72 6f 72  | these two error|
00000fe0  73 20 69 74 20 69 73 20  6e 65 63 65 73 73 61 72  |s it is necessar|
00000ff0  79 20 66 6f 72 20 74 68  65 20 53 57 52 0d 69 6e  |y for the SWR.in|
00001000  74 65 72 70 72 65 74 65  72 20 74 6f 20 69 6e 74  |terpreter to int|
00001010  65 72 63 65 70 74 20 73  65 72 76 69 63 65 20 63  |ercept service c|
00001020  61 6c 6c 20 36 20 61 6e  64 20 74 65 73 74 20 74  |all 6 and test t|
00001030  68 65 20 63 6f 6e 74 65  6e 74 20 6f 66 20 74 68  |he content of th|
00001040  65 0d 6d 65 6d 6f 72 79  20 6c 6f 63 61 74 69 6f  |e.memory locatio|
00001050  6e 20 73 74 6f 72 65 64  20 69 6e 20 74 68 65 20  |n stored in the |
00001060  65 72 72 6f 72 20 6e 75  6d 62 65 72 20 70 6f 69  |error number poi|
00001070  6e 74 65 72 20 74 6f 20  73 65 65 20 69 66 20 69  |nter to see if i|
00001080  74 0d 63 6f 6e 74 61 69  6e 73 20 65 69 74 68 65  |t.contains eithe|
00001090  72 20 26 42 45 20 6f 72  20 26 43 36 2e 20 49 66  |r &BE or &C6. If|
000010a0  20 65 69 74 68 65 72 20  6f 66 20 74 68 65 73 65  | either of these|
000010b0  20 6e 75 6d 62 65 72 73  20 69 73 20 66 6f 75 6e  | numbers is foun|
000010c0  64 20 74 68 65 0d 6e 65  77 20 65 72 72 6f 72 20  |d the.new error |
000010d0  68 61 6e 64 6c 69 6e 67  20 72 6f 75 74 69 6e 65  |handling routine|
000010e0  20 63 61 6e 20 70 72 6f  63 65 73 73 20 74 68 65  | can process the|
000010f0  20 65 72 72 6f 72 2c 20  69 66 20 6e 65 69 74 68  | error, if neith|
00001100  65 72 20 69 73 20 66 6f  75 6e 64 0d 74 68 65 20  |er is found.the |
00001110  72 65 67 69 73 74 65 72  73 20 6d 75 73 74 20 62  |registers must b|
00001120  65 20 72 65 73 74 6f 72  65 64 20 61 6e 64 20 63  |e restored and c|
00001130  6f 6e 74 72 6f 6c 20 70  61 73 73 65 64 20 62 61  |ontrol passed ba|
00001140  63 6b 20 74 6f 20 74 68  65 20 4d 4f 53 2e 0d 0d  |ck to the MOS...|
00001150  20 20 54 68 65 20 70 75  72 70 6f 73 65 20 6f 66  |  The purpose of|
00001160  20 74 68 65 20 70 72 6f  67 72 61 6d 20 69 73 20  | the program is |
00001170  74 6f 20 63 6f 70 79 20  61 6c 6c 20 74 68 65 20  |to copy all the |
00001180  66 69 6c 65 73 20 66 72  6f 6d 20 61 20 64 69 73  |files from a dis|
00001190  63 20 69 6e 0d 64 72 69  76 65 20 30 20 6f 6e 74  |c in.drive 0 ont|
000011a0  6f 20 61 20 64 69 73 63  20 69 6e 20 64 72 69 76  |o a disc in driv|
000011b0  65 20 31 2e 20 54 6f 20  64 6f 20 74 68 69 73 20  |e 1. To do this |
000011c0  74 68 65 20 70 72 6f 67  72 61 6d 20 77 69 6c 6c  |the program will|
000011d0  20 73 74 6f 72 65 20 64  61 74 61 0d 63 6f 6e 63  | store data.conc|
000011e0  65 72 6e 65 64 20 77 69  74 68 20 74 68 65 20 74  |erned with the t|
000011f0  61 73 6b 20 69 6e 20 69  74 73 20 70 72 69 76 61  |ask in its priva|
00001200  74 65 20 77 6f 72 6b 73  70 61 63 65 2e 20 54 68  |te workspace. Th|
00001210  65 20 64 61 74 61 20 73  74 6f 72 65 64 20 69 6e  |e data stored in|
00001220  0d 70 72 69 76 61 74 65  20 77 6f 72 6b 73 70 61  |.private workspa|
00001230  63 65 20 69 6e 63 6c 75  64 65 73 20 61 20 66 6c  |ce includes a fl|
00001240  61 67 20 77 68 69 63 68  20 69 6e 64 69 63 61 74  |ag which indicat|
00001250  65 73 20 77 68 65 74 68  65 72 20 6f 72 20 6e 6f  |es whether or no|
00001260  74 20 74 68 65 0d 75 74  69 6c 69 74 79 20 69 73  |t the.utility is|
00001270  20 61 63 74 69 76 65 2e  20 49 66 20 74 68 65 20  | active. If the |
00001280  75 74 69 6c 69 74 79 20  69 73 20 61 63 74 69 76  |utility is activ|
00001290  65 20 74 68 65 20 69 6e  74 65 72 70 72 65 74 65  |e the interprete|
000012a0  72 20 63 61 6e 20 74 72  61 70 0d 61 6e 64 20 70  |r can trap.and p|
000012b0  72 6f 63 65 73 73 20 74  68 65 20 63 61 74 20 66  |rocess the cat f|
000012c0  75 6c 6c 20 61 6e 64 20  64 69 73 63 20 66 75 6c  |ull and disc ful|
000012d0  6c 20 65 72 72 6f 72 73  2e 20 49 66 20 69 74 20  |l errors. If it |
000012e0  69 73 20 6e 6f 74 20 61  63 74 69 76 65 20 74 68  |is not active th|
000012f0  65 0d 69 6e 74 65 72 70  72 65 74 65 72 20 6d 75  |e.interpreter mu|
00001300  73 74 20 6e 6f 74 20 74  72 61 70 20 74 68 65 6d  |st not trap them|
00001310  2e 0d 0d 20 20 54 68 65  20 72 6f 75 74 69 6e 65  |...  The routine|
00001320  20 69 6e 20 66 69 67 75  72 65 20 31 33 2e 32 20  | in figure 13.2 |
00001330  69 73 20 74 61 6b 65 6e  20 66 72 6f 6d 20 46 49  |is taken from FI|
00001340  4c 45 53 20 61 6e 64 20  74 65 73 74 73 20 61 20  |LES and tests a |
00001350  66 6c 61 67 20 73 65 74  0d 75 70 20 69 6e 20 74  |flag set.up in t|
00001360  68 65 20 6c 61 73 74 20  62 79 74 65 20 6f 66 20  |he last byte of |
00001370  74 68 65 20 66 69 72 73  74 20 70 61 67 65 20 6f  |the first page o|
00001380  66 20 70 72 69 76 61 74  65 20 77 6f 72 6b 73 70  |f private worksp|
00001390  61 63 65 2e 20 54 68 69  73 20 62 79 74 65 0d 73  |ace. This byte.s|
000013a0  74 6f 72 65 73 20 26 46  46 20 69 66 20 74 68 65  |tores &FF if the|
000013b0  20 75 74 69 6c 69 74 79  20 69 73 20 61 63 74 69  | utility is acti|
000013c0  76 65 20 61 6e 64 20 26  30 30 20 69 66 20 69 74  |ve and &00 if it|
000013d0  20 69 73 20 6e 6f 74 2e  20 43 6f 6e 74 72 6f 6c  | is not. Control|
000013e0  20 77 69 6c 6c 0d 6f 6e  6c 79 20 70 61 73 73 20  | will.only pass |
000013f0  74 6f 20 74 68 65 20 6e  65 77 20 65 72 72 6f 72  |to the new error|
00001400  20 68 61 6e 64 6c 65 72  20 69 66 20 74 68 65 20  | handler if the |
00001410  75 74 69 6c 69 74 79 20  69 73 20 61 63 74 69 76  |utility is activ|
00001420  65 20 61 6e 64 20 69 66  0d 65 69 74 68 65 72 20  |e and if.either |
00001430  74 68 65 20 63 61 74 20  66 75 6c 6c 20 6f 72 20  |the cat full or |
00001440  64 69 73 63 20 66 75 6c  6c 20 65 72 72 6f 72 20  |disc full error |
00001450  68 61 73 20 62 65 65 6e  20 67 65 6e 65 72 61 74  |has been generat|
00001460  65 64 2e 20 54 68 65 20  66 6c 61 67 20 69 73 0d  |ed. The flag is.|
00001470  73 65 74 20 75 70 20 77  68 65 6e 20 74 68 65 20  |set up when the |
00001480  70 72 69 76 61 74 65 20  77 6f 72 6b 73 70 61 63  |private workspac|
00001490  65 20 69 73 20 63 6c 61  69 6d 65 64 20 61 6e 64  |e is claimed and|
000014a0  20 73 77 69 74 63 68 65  64 20 6f 6e 20 61 6e 64  | switched on and|
000014b0  20 6f 66 66 0d 77 68 65  6e 20 74 68 65 20 75 74  | off.when the ut|
000014c0  69 6c 69 74 79 20 73 74  61 72 74 73 20 61 6e 64  |ility starts and|
000014d0  20 66 69 6e 69 73 68 65  73 2e 0d 0d 0d 0d 20 20  | finishes.....  |
000014e0  20 20 20 20 20 20 20 50  48 41 0d 20 20 20 20 20  |       PHA.     |
000014f0  20 20 20 20 43 4d 50 20  23 36 20 20 20 20 20 20  |    CMP #6      |
00001500  20 20 20 20 20 5c 20 69  73 20 69 74 20 73 65 72  |     \ is it ser|
00001510  76 69 63 65 20 63 61 6c  6c 20 36 3f 0d 20 20 20  |vice call 6?.   |
00001520  20 20 20 20 20 20 42 4e  45 20 6f 75 74 20 20 20  |      BNE out   |
00001530  20 20 20 20 20 20 20 5c  20 62 72 61 6e 63 68 20  |       \ branch |
00001540  69 66 20 6e 6f 74 0d 20  20 20 20 20 20 20 20 20  |if not.         |
00001550  54 58 41 20 20 20 20 20  20 20 20 20 20 20 20 20  |TXA             |
00001560  20 5c 20 73 74 6f 72 65  20 61 6c 6c 20 72 65 67  | \ store all reg|
00001570  69 73 74 65 72 73 0d 20  20 20 20 20 20 20 20 20  |isters.         |
00001580  50 48 41 0d 20 20 20 20  20 20 20 20 20 54 59 41  |PHA.         TYA|
00001590  0d 20 20 20 20 20 20 20  20 20 50 48 41 0d 20 20  |.         PHA.  |
000015a0  20 20 20 20 20 20 20 4c  44 58 20 26 46 34 20 20  |       LDX &F4  |
000015b0  20 20 20 20 20 20 20 20  5c 20 6c 6f 61 64 20 74  |        \ load t|
000015c0  68 69 73 20 72 6f 6d 20  6e 75 6d 62 65 72 0d 20  |his rom number. |
000015d0  20 20 20 20 20 20 20 20  4c 44 41 20 26 44 46 30  |        LDA &DF0|
000015e0  2c 58 20 20 20 20 20 20  20 5c 20 66 69 6e 64 20  |,X       \ find |
000015f0  73 74 61 72 74 20 6f 66  20 77 6f 72 6b 73 70 61  |start of workspa|
00001600  63 65 0d 20 20 20 20 20  20 20 20 20 53 54 41 20  |ce.         STA |
00001610  26 37 33 20 20 20 20 20  20 20 20 20 20 5c 20 73  |&73          \ s|
00001620  74 6f 72 65 20 68 69 67  68 20 62 79 74 65 20 6f  |tore high byte o|
00001630  66 20 73 74 61 72 74 20  6f 66 20 77 6f 72 6b 73  |f start of works|
00001640  70 61 63 65 0d 20 20 20  20 20 20 20 20 20 4c 44  |pace.         LD|
00001650  41 20 23 30 20 20 20 20  20 20 20 20 20 20 20 5c  |A #0           \|
00001660  20 77 6f 72 6b 73 70 61  63 65 20 61 6c 77 61 79  | workspace alway|
00001670  73 20 73 74 61 72 74 73  20 61 74 20 70 61 67 65  |s starts at page|
00001680  20 62 6f 75 6e 64 61 72  79 0d 20 20 20 20 20 20  | boundary.      |
00001690  20 20 20 53 54 41 20 26  37 32 20 20 20 20 20 20  |   STA &72      |
000016a0  20 20 20 20 5c 20 6c 6f  77 20 62 79 74 65 20 6f  |    \ low byte o|
000016b0  66 20 73 74 61 72 74 20  6f 66 20 77 6f 72 6b 73  |f start of works|
000016c0  70 61 63 65 0d 20 20 20  20 20 20 20 20 20 4c 44  |pace.         LD|
000016d0  59 20 23 26 46 46 20 20  20 20 20 20 20 20 20 5c  |Y #&FF         \|
000016e0  20 66 6c 61 67 20 61 64  64 72 65 73 73 20 6f 66  | flag address of|
000016f0  66 73 65 74 0d 20 20 20  20 20 20 20 20 20 4c 44  |fset.         LD|
00001700  41 20 28 26 37 32 29 2c  59 20 20 20 20 20 20 5c  |A (&72),Y      \|
00001710  20 6c 6f 61 64 20 66 6c  61 67 0d 20 20 20 20 20  | load flag.     |
00001720  20 20 20 20 42 45 51 20  6e 6f 74 6f 6e 20 20 20  |    BEQ noton   |
00001730  20 20 20 20 20 5c 20 62  72 61 6e 63 68 20 69 66  |     \ branch if|
00001740  20 75 74 69 6c 69 74 79  20 6e 6f 74 20 61 63 74  | utility not act|
00001750  69 76 65 0d 20 20 20 20  20 20 20 20 20 49 4e 59  |ive.         INY|
00001760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00001770  59 3d 30 0d 20 20 20 20  20 20 20 20 20 4c 44 41  |Y=0.         LDA|
00001780  20 28 26 46 44 29 2c 59  20 20 20 20 20 20 5c 20  | (&FD),Y      \ |
00001790  6c 6f 61 64 20 65 72 72  72 6f 72 20 6e 75 6d 62  |load errror numb|
000017a0  65 72 0d 20 20 20 20 20  20 20 20 20 43 4d 50 20  |er.         CMP |
000017b0  23 26 42 45 20 20 20 20  20 20 20 20 20 5c 20 43  |#&BE         \ C|
000017c0  61 74 20 66 75 6c 6c 20  65 72 72 6f 72 20 6e 75  |at full error nu|
000017d0  6d 62 65 72 0d 20 20 20  20 20 20 20 20 20 42 45  |mber.         BE|
000017e0  51 20 63 68 61 6e 67 65  20 20 20 20 20 20 20 5c  |Q change       \|
000017f0  20 62 72 61 6e 63 68 20  69 66 20 43 61 74 20 66  | branch if Cat f|
00001800  75 6c 6c 20 65 72 72 6f  72 0d 20 20 20 20 20 20  |ull error.      |
00001810  20 20 20 43 4d 50 20 23  26 43 36 20 20 20 20 20  |   CMP #&C6     |
00001820  20 20 20 20 5c 20 44 69  73 63 20 66 75 6c 6c 20  |    \ Disc full |
00001830  65 72 72 6f 72 20 6e 75  6d 62 65 72 0d 20 20 20  |error number.   |
00001840  20 20 20 20 20 20 42 45  51 20 63 68 61 6e 67 65  |      BEQ change|
00001850  20 20 20 20 20 20 20 5c  20 62 72 61 6e 63 68 20  |       \ branch |
00001860  69 66 20 44 69 73 63 20  66 75 6c 6c 20 65 72 72  |if Disc full err|
00001870  6f 72 0d 2e 6e 6f 74 6f  6e 0d 20 20 20 20 20 20  |or..noton.      |
00001880  20 20 20 50 4c 41 20 20  20 20 20 20 20 20 20 20  |   PLA          |
00001890  20 20 20 20 5c 20 72 65  73 74 6f 72 65 20 61 6c  |    \ restore al|
000018a0  6c 20 72 65 67 69 73 74  65 72 73 0d 20 20 20 20  |l registers.    |
000018b0  20 20 20 20 20 54 41 59  0d 20 20 20 20 20 20 20  |     TAY.       |
000018c0  20 20 50 4c 41 0d 20 20  20 20 20 20 20 20 20 54  |  PLA.         T|
000018d0  41 58 0d 2e 6f 75 74 0d  20 20 20 20 20 20 20 20  |AX..out.        |
000018e0  20 50 4c 41 0d 20 20 20  20 20 20 20 20 20 52 54  | PLA.         RT|
000018f0  53 0d 2e 63 68 61 6e 67  65 0d 0d 46 69 67 75 72  |S..change..Figur|
00001900  65 20 31 33 2e 32 20 20  43 68 65 63 6b 69 6e 67  |e 13.2  Checking|
00001910  20 74 68 65 20 75 74 69  6c 69 74 79 20 61 63 74  | the utility act|
00001920  69 76 65 20 66 6c 61 67  2e 0d 2d 2d 2d 2d 2d 2d  |ive flag..------|
00001930  2d 2d 2d 2d 2d 20 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |-----  ---------|
00001940  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001950  2d 2d 2d 2d 2d 2d 2d 2d  0d 0d 0d 20 20 41 73 20  |--------...  As |
00001960  77 65 6c 6c 20 61 73 20  61 20 75 74 69 6c 69 74  |well as a utilit|
00001970  79 20 61 63 74 69 76 65  20 66 6c 61 67 20 74 68  |y active flag th|
00001980  65 72 65 20 69 73 20 71  75 69 74 65 20 61 20 6c  |ere is quite a l|
00001990  6f 74 20 6f 66 20 6f 74  68 65 72 20 64 61 74 61  |ot of other data|
000019a0  0d 73 74 6f 72 65 64 20  69 6e 20 70 72 69 76 61  |.stored in priva|
000019b0  74 65 20 77 6f 72 6b 73  70 61 63 65 2e 20 54 68  |te workspace. Th|
000019c0  65 20 65 6e 74 69 72 65  20 63 61 74 61 6c 6f 67  |e entire catalog|
000019d0  75 65 20 6f 66 20 64 72  69 76 65 20 30 20 69 73  |ue of drive 0 is|
000019e0  20 73 74 6f 72 65 64 0d  61 6e 64 20 77 6f 72 6b  | stored.and work|
000019f0  73 70 61 63 65 20 69 73  20 6e 65 65 64 65 64 20  |space is needed |
00001a00  66 6f 72 20 61 20 63 6f  6d 6d 61 6e 64 20 6c 69  |for a command li|
00001a10  6e 65 20 69 6e 74 65 72  70 72 65 74 65 72 20 62  |ne interpreter b|
00001a20  75 66 66 65 72 20 61 6e  64 20 61 6e 0d 4f 73 77  |uffer and an.Osw|
00001a30  6f 72 64 20 70 61 72 61  6d 65 74 65 72 20 62 6c  |ord parameter bl|
00001a40  6f 63 6b 2e 20 54 68 65  20 70 72 6f 67 72 61 6d  |ock. The program|
00001a50  20 6e 65 65 64 73 20 74  6f 20 63 6c 61 69 6d 20  | needs to claim |
00001a60  74 77 6f 20 70 61 67 65  73 20 6f 66 0d 70 72 69  |two pages of.pri|
00001a70  76 61 74 65 20 77 6f 72  6b 73 70 61 63 65 20 74  |vate workspace t|
00001a80  6f 20 73 74 6f 72 65 20  61 6c 6c 20 74 68 65 73  |o store all thes|
00001a90  65 20 64 61 74 61 2e 0d  0d 20 20 46 69 67 75 72  |e data...  Figur|
00001aa0  65 20 31 33 2e 33 20 69  73 20 61 20 6d 65 6d 6f  |e 13.3 is a memo|
00001ab0  72 79 20 64 75 6d 70 20  6f 66 20 74 68 72 65 65  |ry dump of three|
00001ac0  20 70 61 72 74 73 20 6f  66 20 74 68 65 20 74 77  | parts of the tw|
00001ad0  6f 20 70 61 67 65 73 20  6f 66 0d 70 72 69 76 61  |o pages of.priva|
00001ae0  74 65 20 77 6f 72 6b 73  70 61 63 65 20 63 6c 61  |te workspace cla|
00001af0  69 6d 65 64 20 62 79 20  74 68 65 20 70 72 6f 67  |imed by the prog|
00001b00  72 61 6d 20 46 49 4c 45  53 2e 20 54 68 65 20 6d  |ram FILES. The m|
00001b10  65 6d 6f 72 79 20 64 75  6d 70 20 77 61 73 0d 6d  |emory dump was.m|
00001b20  61 64 65 20 77 68 69 6c  65 20 74 68 65 20 70 72  |ade while the pr|
00001b30  6f 67 72 61 6d 20 46 49  4c 45 53 20 77 61 73 20  |ogram FILES was |
00001b40  74 72 61 6e 73 66 65 72  69 6e 67 20 74 68 65 20  |transfering the |
00001b50  66 69 72 73 74 20 66 69  6c 65 20 66 72 6f 6d 20  |first file from |
00001b60  64 72 69 76 65 0d 30 20  74 6f 20 64 72 69 76 65  |drive.0 to drive|
00001b70  20 31 2e 20 49 74 20 73  68 6f 77 73 20 68 6f 77  | 1. It shows how|
00001b80  20 74 68 65 20 70 72 69  76 61 74 65 20 77 6f 72  | the private wor|
00001b90  6b 73 70 61 63 65 20 69  73 20 75 73 65 64 20 62  |kspace is used b|
00001ba0  79 20 74 68 65 0d 70 72  6f 67 72 61 6d 2e 20 49  |y the.program. I|
00001bb0  6e 20 74 68 65 20 63 6f  6d 70 75 74 65 72 20 69  |n the computer i|
00001bc0  6e 20 77 68 69 63 68 20  74 68 65 20 6d 65 6d 6f  |n which the memo|
00001bd0  72 79 20 64 75 6d 70 20  77 61 73 20 6d 61 64 65  |ry dump was made|
00001be0  2c 20 74 68 65 0d 70 72  69 76 61 74 65 20 77 6f  |, the.private wo|
00001bf0  72 6b 73 70 61 63 65 20  63 6c 61 69 6d 65 64 20  |rkspace claimed |
00001c00  62 79 20 46 49 4c 45 53  20 77 61 73 20 69 6e 20  |by FILES was in |
00001c10  70 61 67 65 73 20 26 31  37 20 61 6e 64 20 26 31  |pages &17 and &1|
00001c20  38 2e 20 49 74 20 63 6f  75 6c 64 0d 62 65 20 69  |8. It could.be i|
00001c30  6e 20 61 6e 79 20 74 77  6f 20 63 6f 6e 73 65 63  |n any two consec|
00001c40  75 74 69 76 65 20 70 61  67 65 73 20 64 65 70 65  |utive pages depe|
00001c50  6e 64 69 6e 67 20 6f 6e  20 74 68 65 20 77 6f 72  |nding on the wor|
00001c60  6b 73 70 61 63 65 20 63  6c 61 69 6d 65 64 20 62  |kspace claimed b|
00001c70  79 0d 6f 74 68 65 72 20  72 6f 6d 73 20 61 6e 64  |y.other roms and|
00001c80  20 74 68 65 20 70 72 69  6f 72 69 74 79 20 6f 66  | the priority of|
00001c90  20 74 68 65 20 70 72 6f  67 72 61 6d 20 46 49 4c  | the program FIL|
00001ca0  45 53 2e 0d 0d 0d 0d 0d  31 37 30 30 20 20 34 33  |ES......1700  43|
00001cb0  20 34 46 20 35 30 20 35  39 20 32 30 20 33 30 20  | 4F 50 59 20 30 |
00001cc0  32 30 20 33 31 20 20 43  4f 50 59 20 30 20 31 0d  |20 31  COPY 0 1.|
00001cd0  31 37 30 38 20 20 32 30  20 32 34 20 32 45 20 35  |1708  20 24 2E 5|
00001ce0  34 20 35 32 20 34 31 20  34 33 20 34 35 20 20 20  |4 52 41 43 45   |
00001cf0  24 2e 54 52 41 43 45 0d  31 37 31 30 20 20 32 30  |$.TRACE.1710  20|
00001d00  20 32 30 20 30 44 20 30  30 20 30 30 20 30 30 20  | 20 0D 00 00 00 |
00001d10  30 30 20 30 30 20 20 20  20 2e 2e 2e 2e 2e 2e 0d  |00 00    .......|
00001d20  0d 31 37 38 30 20 20 30  30 20 30 30 20 31 38 20  |.1780  00 00 18 |
00001d30  46 46 20 46 46 20 30 33  20 35 33 20 30 30 20 20  |FF FF 03 53 00  |
00001d40  2e 2e 2e 2e 2e 2e 53 2e  0d 31 37 38 38 20 20 30  |......S..1788  0|
00001d50  30 20 32 31 20 30 30 20  30 30 20 30 30 20 30 30  |0 21 00 00 00 00|
00001d60  20 30 30 20 30 30 20 20  2e 21 2e 2e 2e 2e 2e 2e  | 00 00  .!......|
00001d70  0d 0d 31 37 46 38 20 20  30 30 20 30 30 20 30 30  |..17F8  00 00 00|
00001d80  20 30 30 20 30 30 20 30  30 20 30 30 20 46 46 20  | 00 00 00 00 FF |
00001d90  20 2e 2e 2e 2e 2e 2e 2e  2e 0d 31 38 30 30 20 20  | .........1800  |
00001da0  35 33 20 35 37 20 35 32  20 32 30 20 35 33 20 34  |53 57 52 20 53 4|
00001db0  46 20 34 36 20 35 34 20  20 53 57 52 20 53 4f 46  |F 46 54  SWR SOF|
00001dc0  54 0d 31 38 30 38 20 20  35 34 20 35 32 20 34 31  |T.1808  54 52 41|
00001dd0  20 34 33 20 34 35 20 32  30 20 32 30 20 32 34 20  | 43 45 20 20 24 |
00001de0  20 54 52 41 43 45 20 20  24 0d 31 38 31 30 20 20  | TRACE  $.1810  |
00001df0  34 46 20 35 33 20 35 37  20 34 46 20 35 32 20 34  |4F 53 57 4F 52 4|
00001e00  34 20 32 30 20 32 34 20  20 4f 53 57 4f 52 44 20  |4 20 24  OSWORD |
00001e10  24 0d 31 38 31 38 20 20  34 46 20 35 33 20 34 32  |$.1818  4F 53 42|
00001e20  20 35 39 20 35 34 20 34  35 20 32 30 20 32 34 20  | 59 54 45 20 24 |
00001e30  20 4f 53 42 59 54 45 20  24 0d 31 38 32 30 20 20  | OSBYTE $.1820  |
00001e40  34 46 20 35 33 20 35 37  20 34 34 20 34 35 20 34  |4F 53 57 44 45 4|
00001e50  44 20 34 46 20 32 34 20  20 4f 53 57 44 45 4d 4f  |D 4F 24  OSWDEMO|
00001e60  24 0d 0d 46 69 67 75 72  65 20 31 33 2e 33 20 20  |$..Figure 13.3  |
00001e70  50 61 72 74 73 20 6f 66  20 61 20 6d 65 6d 6f 72  |Parts of a memor|
00001e80  79 20 64 75 6d 70 20 6f  66 20 70 72 69 76 61 74  |y dump of privat|
00001e90  65 20 77 6f 72 6b 73 70  61 63 65 2e 0d 2d 2d 2d  |e workspace..---|
00001ea0  2d 2d 2d 2d 2d 2d 2d 2d  20 20 2d 2d 2d 2d 2d 2d  |--------  ------|
00001eb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001ed0  2d 2d 2d 2d 2d 2d 0d 0d  0d 0d 20 20 54 68 65 20  |------....  The |
00001ee0  64 72 69 76 65 20 30 20  63 61 74 61 6c 6f 67 75  |drive 0 catalogu|
00001ef0  65 20 69 73 20 72 65 61  64 20 75 73 69 6e 67 20  |e is read using |
00001f00  4f 73 77 6f 72 64 20 26  37 46 20 61 6e 64 20 73  |Osword &7F and s|
00001f10  74 6f 72 65 64 20 69 6e  20 74 68 65 0d 73 65 63  |tored in the.sec|
00001f20  6f 6e 64 20 70 61 67 65  20 6f 66 20 74 68 65 20  |ond page of the |
00001f30  70 72 69 76 61 74 65 20  77 6f 72 6b 73 70 61 63  |private workspac|
00001f40  65 20 28 70 61 67 65 20  26 31 38 20 69 6e 20 74  |e (page &18 in t|
00001f50  68 69 73 20 63 61 73 65  29 2e 20 54 68 65 0d 4f  |his case). The.O|
00001f60  73 77 6f 72 64 20 70 61  72 61 6d 65 74 65 72 20  |sword parameter |
00001f70  62 6c 6f 63 6b 20 73 74  61 72 74 73 20 61 74 20  |block starts at |
00001f80  26 31 37 38 30 2e 20 54  68 65 20 63 6f 6e 74 65  |&1780. The conte|
00001f90  6e 74 73 20 6f 66 20 74  68 69 73 20 62 75 66 66  |nts of this buff|
00001fa0  65 72 0d 28 66 69 67 75  72 65 20 31 33 2e 33 29  |er.(figure 13.3)|
00001fb0  20 69 6e 64 69 63 61 74  65 20 61 20 73 75 63 63  | indicate a succ|
00001fc0  65 73 73 66 75 6c 20 72  65 61 64 20 64 61 74 61  |essful read data|
00001fd0  20 6d 75 6c 74 69 20 73  65 63 74 6f 72 20 66 72  | multi sector fr|
00001fe0  6f 6d 20 64 72 69 76 65  0d 30 2c 20 74 72 61 63  |om drive.0, trac|
00001ff0  6b 20 30 2c 20 73 65 63  74 6f 72 20 30 20 77 69  |k 0, sector 0 wi|
00002000  74 68 20 64 61 74 61 20  73 74 6f 72 65 64 20 61  |th data stored a|
00002010  74 20 26 46 46 46 46 31  38 30 30 2e 20 0d 0d 20  |t &FFFF1800. .. |
00002020  20 54 68 65 20 63 6f 6d  6d 61 6e 64 20 6c 69 6e  | The command lin|
00002030  65 20 69 6e 74 65 72 70  72 65 74 65 72 20 62 75  |e interpreter bu|
00002040  66 66 65 72 20 73 74 61  72 74 73 20 61 74 20 26  |ffer starts at &|
00002050  31 37 30 30 2e 20 54 68  65 20 70 72 6f 67 72 61  |1700. The progra|
00002060  6d 0d 74 72 61 6e 73 66  65 72 73 20 61 6c 6c 20  |m.transfers all |
00002070  74 68 65 20 66 69 6c 65  73 20 62 79 20 63 6f 70  |the files by cop|
00002080  79 69 6e 67 20 65 61 63  68 20 66 69 6c 65 6e 61  |ying each filena|
00002090  6d 65 20 66 72 6f 6d 20  74 68 65 20 64 72 69 76  |me from the driv|
000020a0  65 20 30 0d 63 61 74 61  6c 6f 67 75 65 20 28 69  |e 0.catalogue (i|
000020b0  6e 20 70 61 67 65 20 26  31 38 29 20 69 6e 74 6f  |n page &18) into|
000020c0  20 74 68 69 73 20 62 75  66 66 65 72 20 61 6e 64  | this buffer and|
000020d0  20 74 68 65 6e 20 63 61  6c 6c 69 6e 67 20 74 68  | then calling th|
000020e0  65 20 63 6f 6d 6d 61 6e  64 0d 6c 69 6e 65 20 69  |e command.line i|
000020f0  6e 74 65 72 70 72 65 74  65 72 2e 0d 0d 20 20 54  |nterpreter...  T|
00002100  68 65 20 75 74 69 6c 69  74 79 20 61 63 74 69 76  |he utility activ|
00002110  65 20 66 6c 61 67 20 69  73 20 61 74 20 26 31 37  |e flag is at &17|
00002120  46 46 2e 20 54 68 65 20  63 6f 6e 74 65 6e 74 73  |FF. The contents|
00002130  20 6f 66 20 74 68 69 73  20 66 6c 61 67 20 69 6e  | of this flag in|
00002140  0d 66 69 67 75 72 65 20  31 33 2e 32 20 69 6e 64  |.figure 13.2 ind|
00002150  69 63 61 74 65 20 74 68  61 74 20 74 68 65 20 75  |icate that the u|
00002160  74 69 6c 69 74 79 20 77  61 73 20 61 63 74 69 76  |tility was activ|
00002170  65 20 77 68 65 6e 20 74  68 65 20 6d 65 6d 6f 72  |e when the memor|
00002180  79 20 64 75 6d 70 0d 77  61 73 20 6d 61 64 65 2e  |y dump.was made.|
00002190  0d 0d 20 20 54 68 65 72  65 20 61 72 65 20 61 20  |..  There are a |
000021a0  6e 75 6d 62 65 72 20 6f  66 20 70 6f 69 6e 74 65  |number of pointe|
000021b0  72 73 20 73 65 74 20 75  70 20 69 6e 20 7a 65 72  |rs set up in zer|
000021c0  6f 20 70 61 67 65 20 74  6f 20 73 74 6f 72 65 20  |o page to store |
000021d0  74 68 65 0d 61 64 64 72  65 73 73 65 73 20 6f 66  |the.addresses of|
000021e0  20 74 68 65 20 76 61 72  69 6f 75 73 20 6c 6f 63  | the various loc|
000021f0  61 74 69 6f 6e 73 20 69  6e 64 69 72 65 63 74 6c  |ations indirectl|
00002200  79 20 61 64 64 72 65 73  73 65 64 20 69 6e 20 74  |y addressed in t|
00002210  68 65 20 70 72 69 76 61  74 65 0d 77 6f 72 6b 73  |he private.works|
00002220  70 61 63 65 2e 20 54 68  65 20 61 62 73 6f 6c 75  |pace. The absolu|
00002230  74 65 20 61 64 64 72 65  73 73 65 73 20 77 69 6c  |te addresses wil|
00002240  6c 20 64 65 70 65 6e 64  20 6f 6e 20 74 68 65 20  |l depend on the |
00002250  6f 74 68 65 72 20 72 6f  6d 73 20 69 6e 20 74 68  |other roms in th|
00002260  65 0d 63 6f 6d 70 75 74  65 72 20 62 75 74 20 69  |e.computer but i|
00002270  6e 20 74 68 65 20 63 6f  6d 70 75 74 65 72 20 75  |n the computer u|
00002280  73 65 64 20 74 6f 20 67  65 6e 65 72 61 74 65 20  |sed to generate |
00002290  66 69 67 75 72 65 20 31  33 2e 33 20 74 68 65 79  |figure 13.3 they|
000022a0  20 68 61 64 20 74 68 65  0d 76 61 6c 75 65 73 20  | had the.values |
000022b0  73 68 6f 77 6e 20 69 6e  20 66 69 67 75 72 65 20  |shown in figure |
000022c0  31 33 2e 34 2e 0d 0d 0d  0d 0d 4e 61 6d 65 20 20  |13.4......Name  |
000022d0  20 20 20 20 20 68 69 67  68 20 62 79 74 65 20 6c  |     high byte l|
000022e0  6f 77 20 62 79 74 65 20  20 46 75 6e 63 74 69 6f  |ow byte  Functio|
000022f0  6e 0d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |n.--------------|
00002300  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002330  2d 2d 2d 2d 2d 2d 0d 64  69 72 65 63 74 6f 72 79  |------.directory|
00002340  20 20 26 31 37 20 20 20  20 20 20 20 26 30 39 20  |  &17       &09 |
00002350  20 20 20 20 20 54 68 65  20 64 69 72 65 63 74 6f  |     The directo|
00002360  72 79 20 6f 66 20 74 68  65 20 63 75 72 72 65 6e  |ry of the curren|
00002370  74 20 66 69 6c 65 0d 70  72 69 76 61 74 65 20 20  |t file.private  |
00002380  20 20 26 31 37 20 20 20  20 20 20 20 26 30 30 20  |  &17       &00 |
00002390  20 20 20 20 20 54 68 65  20 73 74 61 72 74 20 6f  |     The start o|
000023a0  66 20 70 72 69 76 61 74  65 20 77 6f 72 6b 73 70  |f private worksp|
000023b0  61 63 65 0d 63 61 74 62  75 66 66 20 20 20 20 26  |ace.catbuff    &|
000023c0  31 38 20 20 20 20 20 20  20 26 30 38 20 20 20 20  |18       &08    |
000023d0  20 20 54 68 65 20 61 64  64 72 65 73 73 20 6f 66  |  The address of|
000023e0  20 74 68 65 20 66 69 72  73 74 20 66 69 6c 65 6e  | the first filen|
000023f0  61 6d 65 0d 63 6c 69 62  75 66 66 20 20 20 20 26  |ame.clibuff    &|
00002400  31 37 20 20 20 20 20 20  20 26 30 42 20 20 20 20  |17       &0B    |
00002410  20 20 54 68 65 20 66 69  72 73 74 20 62 79 74 65  |  The first byte|
00002420  20 6f 66 20 74 68 65 20  63 75 72 72 65 6e 74 20  | of the current |
00002430  66 69 6c 65 6e 61 6d 65  0d 62 6c 6f 63 6b 20 20  |filename.block  |
00002440  20 20 20 20 26 31 37 20  20 20 20 20 20 20 26 38  |    &17       &8|
00002450  30 20 20 20 20 20 20 54  68 65 20 4f 73 77 6f 72  |0      The Oswor|
00002460  64 20 70 61 72 61 6d 65  74 65 72 20 62 6c 6f 63  |d parameter bloc|
00002470  6b 0d 0d 46 69 67 75 72  65 20 31 33 2e 34 20 20  |k..Figure 13.4  |
00002480  54 68 65 20 7a 65 72 6f  20 70 61 67 65 20 70 6f  |The zero page po|
00002490  69 6e 74 65 72 73 2e 0d  2d 2d 2d 2d 2d 2d 2d 2d  |inters..--------|
000024a0  2d 2d 2d 20 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |---  -----------|
000024b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 0d 0d 0d  |------------....|
000024c0  20 20 54 68 65 20 53 57  52 20 69 6e 74 65 72 70  |  The SWR interp|
000024d0  72 65 74 65 72 20 69 6e  74 65 72 63 65 70 74 73  |reter intercepts|
000024e0  20 73 65 72 76 69 63 65  20 63 61 6c 6c 20 32 20  | service call 2 |
000024f0  74 6f 20 63 6c 61 69 6d  20 74 77 6f 20 70 61 67  |to claim two pag|
00002500  65 73 20 6f 66 0d 70 72  69 76 61 74 65 20 77 6f  |es of.private wo|
00002510  72 6b 73 70 61 63 65 20  61 6e 64 20 73 65 74 20  |rkspace and set |
00002520  75 70 20 74 68 65 20 75  74 69 6c 69 74 79 20 61  |up the utility a|
00002530  63 74 69 76 65 20 66 6c  61 67 20 74 6f 20 69 6e  |ctive flag to in|
00002540  64 69 63 61 74 65 20 74  68 61 74 0d 74 68 65 20  |dicate that.the |
00002550  75 74 69 6c 69 74 79 20  69 73 20 6e 6f 74 20 79  |utility is not y|
00002560  65 74 20 61 63 74 69 76  65 20 28 6c 69 6e 65 73  |et active (lines|
00002570  20 34 32 30 2d 35 37 30  29 2e 0d 0d 20 20 54 68  | 420-570)...  Th|
00002580  65 20 6f 6e 65 2d 63 6f  6d 6d 61 6e 64 20 69 6e  |e one-command in|
00002590  74 65 72 70 72 65 74 65  72 20 28 6c 69 6e 65 73  |terpreter (lines|
000025a0  20 31 30 35 30 2d 31 32  37 30 29 20 69 73 20 75  | 1050-1270) is u|
000025b0  73 65 64 20 74 6f 20 72  65 63 6f 67 6e 69 73 65  |sed to recognise|
000025c0  0d 74 68 65 20 63 6f 6d  6d 61 6e 64 20 2a 46 49  |.the command *FI|
000025d0  4c 45 53 20 61 6e 64 20  63 6f 6e 74 72 6f 6c 20  |LES and control |
000025e0  69 73 20 70 61 73 73 65  64 20 74 6f 20 74 68 65  |is passed to the|
000025f0  20 6c 61 62 65 6c 20 22  2e 66 6f 75 6e 64 22 20  | label ".found" |
00002600  28 6c 69 6e 65 0d 31 32  38 30 29 2e 20 54 68 65  |(line.1280). The|
00002610  20 70 72 6f 67 72 61 6d  20 69 73 20 64 65 73 69  | program is desi|
00002620  67 6e 65 64 20 74 6f 20  74 72 61 70 20 65 72 72  |gned to trap err|
00002630  6f 72 73 20 67 65 6e 65  72 61 74 65 64 20 69 6e  |ors generated in|
00002640  20 61 6e 6f 74 68 65 72  20 72 6f 6d 0d 61 6e 64  | another rom.and|
00002650  20 66 6f 72 20 74 68 69  73 20 72 65 61 73 6f 6e  | for this reason|
00002660  20 74 68 65 20 73 74 61  63 6b 20 69 73 20 62 61  | the stack is ba|
00002670  6c 61 6e 63 65 64 20 62  65 66 6f 72 65 20 64 6f  |lanced before do|
00002680  69 6e 67 20 61 6e 79 74  68 69 6e 67 20 65 6c 73  |ing anything els|
00002690  65 0d 28 6c 69 6e 65 73  20 31 32 39 30 2d 31 33  |e.(lines 1290-13|
000026a0  31 30 29 2e 20 45 72 72  6f 72 73 20 67 65 6e 65  |10). Errors gene|
000026b0  72 61 74 65 64 20 6f 75  74 73 69 64 65 20 79 6f  |rated outside yo|
000026c0  75 72 20 63 6f 6e 74 72  6f 6c 20 63 61 6e 20 70  |ur control can p|
000026d0  6c 61 79 0d 68 61 76 6f  63 20 77 69 74 68 20 74  |lay.havoc with t|
000026e0  68 65 20 73 74 61 63 6b  20 61 6e 64 20 62 61 6c  |he stack and bal|
000026f0  61 6e 63 69 6e 67 20 69  74 20 61 74 20 74 68 69  |ancing it at thi|
00002700  73 20 73 74 61 67 65 20  6d 69 6e 69 6d 69 73 65  |s stage minimise|
00002710  73 20 74 68 65 0d 70 72  6f 62 6c 65 6d 73 20 74  |s the.problems t|
00002720  68 61 74 20 63 61 6e 20  62 65 20 63 72 65 61 74  |hat can be creat|
00002730  65 64 2e 20 54 68 65 20  70 72 6f 67 72 61 6d 20  |ed. The program |
00002740  63 68 65 63 6b 73 20 74  68 61 74 20 74 68 65 20  |checks that the |
00002750  44 46 53 20 69 73 0d 61  63 74 69 76 65 20 28 6c  |DFS is.active (l|
00002760  69 6e 65 73 20 31 33 32  30 2d 31 33 37 30 29 20  |ines 1320-1370) |
00002770  61 6e 64 20 69 66 20 61  6c 6c 20 69 73 20 77 65  |and if all is we|
00002780  6c 6c 20 70 72 69 6e 74  73 20 61 20 22 43 6f 70  |ll prints a "Cop|
00002790  79 20 61 6c 6c 20 66 69  6c 65 73 20 2d 0d 47 6f  |y all files -.Go|
000027a0  3f 22 20 6d 65 73 73 61  67 65 20 28 6c 69 6e 65  |?" message (line|
000027b0  73 20 31 35 30 30 2d 31  35 32 30 29 2e 20 49 66  |s 1500-1520). If|
000027c0  20 74 68 65 20 75 73 65  72 20 74 79 70 65 73 20  | the user types |
000027d0  61 20 22 59 22 20 63 6f  6e 74 6f 6c 20 69 73 0d  |a "Y" contol is.|
000027e0  70 61 73 73 65 64 20 74  6f 20 74 68 65 20 6c 61  |passed to the la|
000027f0  62 65 6c 20 22 2e 79 65  73 22 20 28 6c 69 6e 65  |bel ".yes" (line|
00002800  20 31 36 33 30 29 2e 0d  0d 20 20 54 68 65 20 7a  | 1630)...  The z|
00002810  65 72 6f 20 70 61 67 65  20 70 6f 69 6e 74 65 72  |ero page pointer|
00002820  73 20 28 66 69 67 75 72  65 20 31 33 2e 34 29 20  |s (figure 13.4) |
00002830  61 72 65 20 73 65 74 20  75 70 20 28 6c 69 6e 65  |are set up (line|
00002840  73 20 31 36 34 30 2d 31  38 31 30 29 0d 61 6e 64  |s 1640-1810).and|
00002850  20 74 68 65 20 75 74 69  6c 69 74 79 20 61 63 74  | the utility act|
00002860  69 76 65 20 66 6c 61 67  20 69 73 20 73 65 74 20  |ive flag is set |
00002870  74 6f 20 69 6e 64 69 63  61 74 65 20 74 68 61 74  |to indicate that|
00002880  20 65 72 72 6f 72 73 20  26 42 45 20 61 6e 64 20  | errors &BE and |
00002890  26 43 36 0d 73 68 6f 75  6c 64 20 62 65 20 74 72  |&C6.should be tr|
000028a0  61 70 70 65 64 20 28 6c  69 6e 65 73 20 31 38 32  |apped (lines 182|
000028b0  30 2d 31 38 34 30 29 2e  20 54 68 65 20 4f 73 77  |0-1840). The Osw|
000028c0  6f 72 64 20 70 61 72 61  6d 65 74 65 72 20 62 6c  |ord parameter bl|
000028d0  6f 63 6b 0d 63 6f 6e 74  65 6e 74 73 20 61 72 65  |ock.contents are|
000028e0  20 63 6f 70 69 65 64 20  69 6e 74 6f 20 74 68 65  | copied into the|
000028f0  20 4f 73 77 6f 72 64 20  62 75 66 66 65 72 20 28  | Osword buffer (|
00002900  6c 69 6e 65 73 20 31 38  35 30 2d 31 39 31 30 29  |lines 1850-1910)|
00002910  20 61 6e 64 20 74 68 65  0d 6d 6f 73 74 20 73 69  | and the.most si|
00002920  67 6e 69 66 69 63 61 6e  74 20 62 79 74 65 20 6f  |gnificant byte o|
00002930  66 20 74 68 65 20 61 64  64 72 65 73 73 20 6f 66  |f the address of|
00002940  20 74 68 65 20 63 61 74  61 6c 6f 67 75 65 20 62  | the catalogue b|
00002950  75 66 66 65 72 20 69 73  20 61 6c 73 6f 0d 73 74  |uffer is also.st|
00002960  6f 72 65 64 20 69 6e 20  74 68 65 20 4f 73 77 6f  |ored in the Oswo|
00002970  72 64 20 62 75 66 66 65  72 20 28 6c 69 6e 65 73  |rd buffer (lines|
00002980  20 31 39 32 30 2d 31 39  34 30 29 2e 20 54 68 65  | 1920-1940). The|
00002990  20 66 69 72 73 74 20 70  61 72 74 20 6f 66 20 74  | first part of t|
000029a0  68 65 0d 2a 43 4f 50 59  20 63 6f 6d 6d 61 6e 64  |he.*COPY command|
000029b0  20 69 73 20 74 72 61 6e  73 66 65 72 65 64 20 69  | is transfered i|
000029c0  6e 74 6f 20 74 68 65 20  63 6f 6d 6d 61 6e 64 20  |nto the command |
000029d0  6c 69 6e 65 20 69 6e 74  65 72 70 72 65 74 65 72  |line interpreter|
000029e0  20 62 75 66 66 65 72 0d  28 6c 69 6e 65 73 20 31  | buffer.(lines 1|
000029f0  39 35 30 2d 32 30 31 30  29 20 61 6e 64 20 74 68  |950-2010) and th|
00002a00  65 20 6c 65 61 73 74 20  73 69 67 6e 69 66 69 63  |e least signific|
00002a10  61 6e 74 20 62 79 74 65  20 6f 66 20 74 68 65 20  |ant byte of the |
00002a20  61 64 64 72 65 73 73 20  6f 66 20 74 68 65 0d 66  |address of the.f|
00002a30  69 72 73 74 20 66 69 6c  65 20 69 6e 20 74 68 65  |irst file in the|
00002a40  20 64 72 69 76 65 20 30  20 63 61 74 61 6c 6f 67  | drive 0 catalog|
00002a50  75 65 20 69 73 20 73 74  6f 72 65 64 20 69 6e 20  |ue is stored in |
00002a60  74 68 65 20 7a 65 72 6f  20 70 61 67 65 20 70 6f  |the zero page po|
00002a70  69 6e 74 65 72 0d 74 6f  20 74 68 65 20 63 6f 6d  |inter.to the com|
00002a80  6d 61 6e 64 20 6c 69 6e  65 20 69 6e 74 65 72 70  |mand line interp|
00002a90  72 65 74 65 72 20 62 75  66 66 65 72 20 28 6c 69  |reter buffer (li|
00002aa0  6e 65 20 32 30 32 30 29  2e 20 54 68 65 20 64 72  |ne 2020). The dr|
00002ab0  69 76 65 20 30 0d 63 61  74 61 6c 6f 67 75 65 20  |ive 0.catalogue |
00002ac0  69 73 20 72 65 61 64 20  61 6e 64 20 73 74 6f 72  |is read and stor|
00002ad0  65 64 20 69 6e 20 74 68  65 20 73 65 63 6f 6e 64  |ed in the second|
00002ae0  20 70 61 67 65 20 6f 66  20 74 68 65 20 70 72 69  | page of the pri|
00002af0  76 61 74 65 0d 77 6f 72  6b 73 70 61 63 65 20 28  |vate.workspace (|
00002b00  6c 69 6e 65 73 20 32 30  33 30 2d 32 30 36 30 29  |lines 2030-2060)|
00002b10  2e 0d 0d 20 20 54 68 65  20 66 69 6c 65 73 20 61  |...  The files a|
00002b20  72 65 20 74 72 61 6e 73  66 65 72 65 64 2c 20 6f  |re transfered, o|
00002b30  6e 65 20 61 74 20 61 20  74 69 6d 65 2c 20 66 72  |ne at a time, fr|
00002b40  6f 6d 20 64 72 69 76 65  20 30 20 74 6f 20 64 72  |om drive 0 to dr|
00002b50  69 76 65 20 31 2e 0d 28  6c 69 6e 65 73 20 32 30  |ive 1..(lines 20|
00002b60  37 30 2d 32 33 32 30 29  2e 20 55 70 20 74 6f 20  |70-2320). Up to |
00002b70  33 31 20 66 69 6c 65 73  20 77 69 6c 6c 20 62 65  |31 files will be|
00002b80  20 63 6f 70 69 65 64 20  62 75 74 20 69 66 20 65  | copied but if e|
00002b90  69 74 68 65 72 20 74 68  65 20 63 61 74 0d 66 75  |ither the cat.fu|
00002ba0  6c 6c 20 6f 72 20 64 69  73 63 20 66 75 6c 6c 20  |ll or disc full |
00002bb0  65 72 72 6f 72 73 20 69  73 20 67 65 6e 65 72 61  |errors is genera|
00002bc0  74 65 64 20 62 79 20 74  68 65 20 44 46 53 20 74  |ted by the DFS t|
00002bd0  68 65 20 69 6e 74 65 72  70 72 65 74 65 72 20 77  |he interpreter w|
00002be0  69 6c 6c 0d 74 72 61 70  20 74 68 65 20 65 72 72  |ill.trap the err|
00002bf0  6f 72 20 28 6c 69 6e 65  73 20 36 31 30 2d 38 30  |or (lines 610-80|
00002c00  30 29 20 61 6e 64 20 70  61 73 73 20 63 6f 6e 74  |0) and pass cont|
00002c10  72 6f 6c 20 74 6f 20 74  68 65 20 6c 61 62 65 6c  |rol to the label|
00002c20  20 22 2e 63 68 61 6e 67  65 22 0d 28 6c 69 6e 65  | ".change".(line|
00002c30  20 38 39 30 29 2e 20 54  68 65 20 73 74 61 63 6b  | 890). The stack|
00002c40  20 69 73 20 70 75 6c 6c  65 64 20 73 69 78 20 74  | is pulled six t|
00002c50  69 6d 65 73 20 74 6f 20  62 61 6c 61 6e 63 65 20  |imes to balance |
00002c60  69 74 2e 20 54 68 65 20  73 74 61 63 6b 20 68 61  |it. The stack ha|
00002c70  73 0d 74 68 65 20 72 65  67 69 73 74 65 72 73 20  |s.the registers |
00002c80  66 72 6f 6d 20 74 68 65  20 53 57 52 20 69 6e 74  |from the SWR int|
00002c90  65 72 70 72 65 74 65 72  20 61 73 20 77 65 6c 6c  |erpreter as well|
00002ca0  20 61 73 20 74 68 65 20  73 74 61 74 75 73 20 72  | as the status r|
00002cb0  65 67 69 73 74 65 72 0d  61 6e 64 20 72 65 74 75  |egister.and retu|
00002cc0  72 6e 20 61 64 64 72 65  73 73 20 70 75 73 68 65  |rn address pushe|
00002cd0  64 20 6f 6e 20 77 68 65  6e 20 74 68 65 20 44 46  |d on when the DF|
00002ce0  53 20 42 52 4b 20 77 61  73 20 65 78 65 63 75 74  |S BRK was execut|
00002cf0  65 64 2e 20 54 68 65 73  65 20 63 61 6e 0d 61 6c  |ed. These can.al|
00002d00  6c 20 62 65 20 64 69 73  63 61 72 64 65 64 2e 20  |l be discarded. |
00002d10  54 68 65 20 70 72 6f 67  72 61 6d 20 70 72 6f 6d  |The program prom|
00002d20  70 74 73 20 74 68 65 20  75 73 65 72 20 74 6f 20  |pts the user to |
00002d30  63 68 61 6e 67 65 20 74  68 65 20 64 69 73 63 20  |change the disc |
00002d40  69 6e 0d 64 72 69 76 65  20 31 20 28 6c 69 6e 65  |in.drive 1 (line|
00002d50  73 20 39 36 30 2d 31 30  33 30 29 20 61 6e 64 20  |s 960-1030) and |
00002d60  74 68 65 6e 20 72 65 74  75 72 6e 73 20 63 6f 6e  |then returns con|
00002d70  74 72 6f 6c 20 74 6f 20  74 68 65 20 6c 6f 6f 70  |trol to the loop|
00002d80  0d 74 72 61 6e 73 66 65  72 69 6e 67 20 74 68 65  |.transfering the|
00002d90  20 66 69 6c 65 73 20 28  6c 69 6e 65 20 31 30 34  | files (line 104|
00002da0  30 20 61 6e 64 20 6c 69  6e 65 20 32 32 37 30 29  |0 and line 2270)|
00002db0  2e 0d 0d 20 20 57 68 65  6e 20 61 6c 6c 20 74 68  |...  When all th|
00002dc0  65 20 66 69 6c 65 73 20  68 61 76 65 20 62 65 65  |e files have bee|
00002dd0  6e 20 74 72 61 6e 73 66  65 72 65 64 20 66 72 6f  |n transfered fro|
00002de0  6d 20 64 72 69 76 65 20  30 20 74 6f 20 64 72 69  |m drive 0 to dri|
00002df0  76 65 20 31 2c 20 74 68  65 0d 70 72 6f 67 72 61  |ve 1, the.progra|
00002e00  6d 20 63 6c 65 61 72 73  20 74 68 65 20 75 74 69  |m clears the uti|
00002e10  6c 69 74 79 20 61 63 74  69 76 65 20 66 6c 61 67  |lity active flag|
00002e20  20 28 6c 69 6e 65 73 20  32 33 34 30 2d 32 33 36  | (lines 2340-236|
00002e30  30 29 2c 20 66 6c 75 73  68 65 73 20 61 6c 6c 0d  |0), flushes all.|
00002e40  74 68 65 20 62 75 66 66  65 72 73 20 28 6c 69 6e  |the buffers (lin|
00002e50  65 73 20 32 33 38 30 2d  32 34 30 30 29 2c 20 66  |es 2380-2400), f|
00002e60  69 6e 64 73 20 42 41 53  49 43 20 28 6c 69 6e 65  |inds BASIC (line|
00002e70  73 20 32 34 31 30 2d 32  34 34 30 29 20 61 6e 64  |s 2410-2440) and|
00002e80  0d 65 6e 74 65 72 73 20  42 41 53 49 43 20 28 6c  |.enters BASIC (l|
00002e90  69 6e 65 73 20 32 34 35  30 2d 32 34 36 30 29 20  |ines 2450-2460) |
00002ea0  77 68 69 63 68 20 63 6c  65 61 72 73 20 61 6c 6c  |which clears all|
00002eb0  20 65 72 72 6f 72 20 63  6f 6e 64 69 74 69 6f 6e  | error condition|
00002ec0  73 2e 0d 0d 20 20 54 6f  20 6d 6f 64 69 66 79 20  |s...  To modify |
00002ed0  46 49 4c 45 53 20 74 6f  20 70 61 73 73 20 63 6f  |FILES to pass co|
00002ee0  6e 74 72 6f 6c 20 62 61  63 6b 20 74 6f 20 74 68  |ntrol back to th|
00002ef0  65 20 6e 6f 72 6d 61 6c  20 65 72 72 6f 72 20 68  |e normal error h|
00002f00  61 6e 64 6c 69 6e 67 0d  72 6f 75 74 69 6e 65 20  |andling.routine |
00002f10  64 65 6c 65 74 65 20 6c  69 6e 65 73 20 39 33 30  |delete lines 930|
00002f20  2d 39 35 30 20 61 6e 64  20 32 34 31 30 2d 32 34  |-950 and 2410-24|
00002f30  36 30 2e 20 54 79 70 65  20 74 68 65 20 6e 65 77  |60. Type the new|
00002f40  20 6c 69 6e 65 20 32 34  31 30 2e 0d 0d 20 20 32  | line 2410...  2|
00002f50  34 31 30 20 4c 44 41 20  23 30 3a 52 54 53 0d 0d  |410 LDA #0:RTS..|
00002f60  54 68 65 20 70 72 6f 67  72 61 6d 20 77 69 6c 6c  |The program will|
00002f70  20 70 65 72 66 6f 72 6d  20 74 68 65 20 73 61 6d  | perform the sam|
00002f80  65 20 66 75 6e 63 74 69  6f 6e 20 62 75 74 20 72  |e function but r|
00002f90  65 70 6f 72 74 20 74 68  65 20 44 69 73 63 20 66  |eport the Disc f|
00002fa0  75 6c 6c 20 6f 72 0d 43  61 74 20 66 75 6c 6c 20  |ull or.Cat full |
00002fb0  65 72 72 6f 72 20 6d 65  73 73 61 67 65 20 61 74  |error message at|
00002fc0  20 74 68 65 20 65 6e 64  20 6f 66 20 74 68 65 20  | the end of the |
00002fd0  66 69 6c 65 20 74 72 61  6e 73 66 65 72 73 2e 0d  |file transfers..|
00002fe0  0d 20 20 59 6f 75 20 63  6f 75 6c 64 20 61 6c 73  |.  You could als|
00002ff0  6f 20 6d 6f 64 69 66 79  20 74 68 65 20 70 72 6f  |o modify the pro|
00003000  67 72 61 6d 20 74 6f 20  75 73 65 20 70 61 67 65  |gram to use page|
00003010  73 20 26 30 39 20 61 6e  64 20 26 30 41 20 69 6e  |s &09 and &0A in|
00003020  73 74 65 61 64 0d 6f 66  20 70 72 69 76 61 74 65  |stead.of private|
00003030  20 77 6f 72 6b 73 70 61  63 65 2e 20 54 68 69 73  | workspace. This|
00003040  20 77 6f 75 6c 64 20 6d  61 6b 65 20 74 68 65 20  | would make the |
00003050  70 72 6f 67 72 61 6d 20  73 68 6f 72 74 65 72 20  |program shorter |
00003060  61 6e 64 20 6e 6f 74 0d  72 61 69 73 65 20 4f 73  |and not.raise Os|
00003070  68 77 6d 20 61 6e 64 20  50 41 47 45 20 62 75 74  |hwm and PAGE but|
00003080  2c 20 69 66 20 79 6f 75  20 75 73 65 20 74 68 65  |, if you use the|
00003090  73 65 20 70 61 67 65 73  20 69 6e 73 74 65 61 64  |se pages instead|
000030a0  20 6f 66 20 70 72 69 76  61 74 65 0d 77 6f 72 6b  | of private.work|
000030b0  73 70 61 63 65 2c 20 79  6f 75 20 63 61 6e 20 6e  |space, you can n|
000030c0  6f 74 20 62 65 20 73 75  72 65 20 74 68 61 74 20  |ot be sure that |
000030d0  79 6f 75 72 20 77 6f 72  6b 73 70 61 63 65 20 77  |your workspace w|
000030e0  69 6c 6c 20 72 65 6d 61  69 6e 0d 75 6e 63 6f 72  |ill remain.uncor|
000030f0  72 75 70 74 65 64 20 28  73 65 65 20 4d 6f 64 75  |rupted (see Modu|
00003100  6c 65 20 31 31 29 2e 0d  0d 0d 0d 0d 20 20 20 31  |le 11)......   1|
00003110  30 20 52 45 4d 3a 20 46  49 4c 45 53 0d 20 20 20  |0 REM: FILES.   |
00003120  32 30 20 4d 4f 44 45 37  0d 20 20 20 33 30 20 48  |20 MODE7.   30 H|
00003130  49 4d 45 4d 3d 26 33 43  30 30 0d 20 20 20 34 30  |IMEM=&3C00.   40|
00003140  20 44 49 4d 20 73 61 76  65 20 35 30 0d 20 20 20  | DIM save 50.   |
00003150  35 30 20 64 69 66 66 3d  26 38 30 30 30 2d 48 49  |50 diff=&8000-HI|
00003160  4d 45 4d 0d 20 20 20 36  30 20 64 69 72 65 63 74  |MEM.   60 direct|
00003170  6f 72 79 3d 26 37 30 0d  20 20 20 37 30 20 70 72  |ory=&70.   70 pr|
00003180  69 76 61 74 65 3d 64 69  72 65 63 74 6f 72 79 2b  |ivate=directory+|
00003190  32 0d 20 20 20 38 30 20  63 61 74 62 75 66 66 3d  |2.   80 catbuff=|
000031a0  64 69 72 65 63 74 6f 72  79 2b 34 0d 20 20 20 39  |directory+4.   9|
000031b0  30 20 63 6c 69 62 75 66  66 3d 64 69 72 65 63 74  |0 clibuff=direct|
000031c0  6f 72 79 2b 36 0d 20 20  31 30 30 20 62 6c 6f 63  |ory+6.  100 bloc|
000031d0  6b 3d 64 69 72 65 63 74  6f 72 79 2b 38 0d 20 20  |k=directory+8.  |
000031e0  31 31 30 20 61 64 64 72  65 73 73 3d 64 69 72 65  |110 address=dire|
000031f0  63 74 6f 72 79 2b 31 30  0d 20 20 31 32 30 20 63  |ctory+10.  120 c|
00003200  6f 6d 76 65 63 3d 26 46  32 0d 20 20 31 33 30 20  |omvec=&F2.  130 |
00003210  72 6f 6d 6e 75 6d 62 65  72 3d 26 46 34 0d 20 20  |romnumber=&F4.  |
00003220  31 34 30 20 65 72 72 6f  72 6e 75 6d 3d 26 46 44  |140 errornum=&FD|
00003230  0d 20 20 31 35 30 20 65  72 72 73 74 61 63 6b 3d  |.  150 errstack=|
00003240  26 31 30 30 0d 20 20 31  36 30 20 77 6f 72 6b 73  |&100.  160 works|
00003250  70 61 63 65 3d 26 44 46  30 0d 20 20 31 37 30 20  |pace=&DF0.  170 |
00003260  6f 73 61 72 67 73 3d 26  46 46 44 41 0d 20 20 31  |osargs=&FFDA.  1|
00003270  38 30 20 6f 73 72 64 63  68 3d 26 46 46 45 30 0d  |80 osrdch=&FFE0.|
00003280  20 20 31 39 30 20 6f 73  61 73 63 69 3d 26 46 46  |  190 osasci=&FF|
00003290  45 33 0d 20 20 32 30 30  20 6f 73 6e 65 77 6c 3d  |E3.  200 osnewl=|
000032a0  26 46 46 45 37 0d 20 20  32 31 30 20 6f 73 77 6f  |&FFE7.  210 oswo|
000032b0  72 64 3d 26 46 46 46 31  0d 20 20 32 32 30 20 6f  |rd=&FFF1.  220 o|
000032c0  73 62 79 74 65 3d 26 46  46 46 34 0d 20 20 32 33  |sbyte=&FFF4.  23|
000032d0  30 20 6f 73 63 6c 69 3d  26 46 46 46 37 0d 20 20  |0 oscli=&FFF7.  |
000032e0  32 34 30 20 46 4f 52 20  70 61 73 73 20 3d 20 30  |240 FOR pass = 0|
000032f0  20 54 4f 20 32 20 53 54  45 50 20 32 0d 20 20 32  | TO 2 STEP 2.  2|
00003300  35 30 20 50 25 3d 48 49  4d 45 4d 0d 20 20 32 36  |50 P%=HIMEM.  26|
00003310  30 20 5b 20 20 20 20 20  20 20 4f 50 54 20 70 61  |0 [       OPT pa|
00003320  73 73 0d 20 20 32 37 30  20 20 20 20 20 20 20 20  |ss.  270        |
00003330  20 42 52 4b 0d 20 20 32  38 30 20 20 20 20 20 20  | BRK.  280      |
00003340  20 20 20 42 52 4b 0d 20  20 32 39 30 20 20 20 20  |   BRK.  290    |
00003350  20 20 20 20 20 42 52 4b  0d 20 20 33 30 30 20 20  |     BRK.  300  |
00003360  20 20 20 20 20 20 20 4a  4d 50 20 73 65 72 76 69  |       JMP servi|
00003370  63 65 2b 64 69 66 66 0d  20 20 33 31 30 20 20 20  |ce+diff.  310   |
00003380  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 62  |      OPT FNequb|
00003390  28 26 38 32 29 0d 20 20  33 32 30 20 20 20 20 20  |(&82).  320     |
000033a0  20 20 20 20 4f 50 54 20  46 4e 65 71 75 62 28 28  |    OPT FNequb((|
000033b0  63 6f 70 79 72 69 67 68  74 2b 64 69 66 66 29 20  |copyright+diff) |
000033c0  4d 4f 44 20 32 35 36 29  0d 20 20 33 33 30 20 20  |MOD 256).  330  |
000033d0  20 20 20 20 20 20 20 42  52 4b 0d 20 20 33 34 30  |       BRK.  340|
000033e0  20 2e 74 69 74 6c 65 0d  20 20 33 35 30 20 20 20  | .title.  350   |
000033f0  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 73  |      OPT FNequs|
00003400  28 22 46 49 4c 45 53 22  29 0d 20 20 33 36 30 20  |("FILES").  360 |
00003410  2e 63 6f 70 79 72 69 67  68 74 0d 20 20 33 37 30  |.copyright.  370|
00003420  20 20 20 20 20 20 20 20  20 42 52 4b 0d 20 20 33  |         BRK.  3|
00003430  38 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |80         OPT F|
00003440  4e 65 71 75 73 28 22 28  43 29 20 47 6f 72 64 6f  |Nequs("(C) Gordo|
00003450  6e 20 48 6f 72 73 69 6e  67 74 6f 6e 20 31 39 38  |n Horsington 198|
00003460  37 22 29 0d 20 20 33 39  30 20 20 20 20 20 20 20  |7").  390       |
00003470  20 20 42 52 4b 0d 20 20  34 30 30 20 2e 73 65 72  |  BRK.  400 .ser|
00003480  76 69 63 65 0d 20 20 34  31 30 20 20 20 20 20 20  |vice.  410      |
00003490  20 20 20 50 48 41 0d 20  20 34 32 30 20 20 20 20  |   PHA.  420    |
000034a0  20 20 20 20 20 43 4d 50  20 23 32 0d 20 20 34 33  |     CMP #2.  43|
000034b0  30 20 20 20 20 20 20 20  20 20 42 4e 45 20 74 72  |0         BNE tr|
000034c0  79 66 6f 75 72 0d 20 20  34 34 30 20 20 20 20 20  |yfour.  440     |
000034d0  20 20 20 20 54 59 41 0d  20 20 34 35 30 20 20 20  |    TYA.  450   |
000034e0  20 20 20 20 20 20 50 48  41 0d 20 20 34 36 30 20  |      PHA.  460 |
000034f0  20 20 20 20 20 20 20 20  53 54 41 20 77 6f 72 6b  |        STA work|
00003500  73 70 61 63 65 2c 58 0d  20 20 34 37 30 20 20 20  |space,X.  470   |
00003510  20 20 20 20 20 20 4c 44  41 20 23 30 0d 20 20 34  |      LDA #0.  4|
00003520  38 30 20 20 20 20 20 20  20 20 20 53 54 41 20 70  |80         STA p|
00003530  72 69 76 61 74 65 0d 20  20 34 39 30 20 20 20 20  |rivate.  490    |
00003540  20 20 20 20 20 53 54 59  20 70 72 69 76 61 74 65  |     STY private|
00003550  2b 31 0d 20 20 35 30 30  20 20 20 20 20 20 20 20  |+1.  500        |
00003560  20 4c 44 59 20 23 26 46  46 0d 20 20 35 31 30 20  | LDY #&FF.  510 |
00003570  20 20 20 20 20 20 20 20  53 54 41 20 28 70 72 69  |        STA (pri|
00003580  76 61 74 65 29 2c 59 20  5c 20 30 20 3d 20 75 74  |vate),Y \ 0 = ut|
00003590  69 6c 69 74 79 20 6f 66  66 0d 20 20 35 32 30 20  |ility off.  520 |
000035a0  20 20 20 20 20 20 20 20  50 4c 41 0d 20 20 35 33  |        PLA.  53|
000035b0  30 20 20 20 20 20 20 20  20 20 54 41 59 0d 20 20  |0         TAY.  |
000035c0  35 34 30 20 20 20 20 20  20 20 20 20 49 4e 59 20  |540         INY |
000035d0  20 20 20 20 20 20 20 20  20 20 5c 20 32 20 70 61  |          \ 2 pa|
000035e0  67 65 73 20 6f 66 0d 20  20 35 35 30 20 20 20 20  |ges of.  550    |
000035f0  20 20 20 20 20 49 4e 59  20 20 20 20 20 20 20 20  |     INY        |
00003600  20 20 20 5c 20 70 72 69  76 61 74 65 20 77 6f 72  |   \ private wor|
00003610  6b 73 70 61 63 65 0d 20  20 35 36 30 20 20 20 20  |kspace.  560    |
00003620  20 20 20 20 20 50 4c 41  0d 20 20 35 37 30 20 20  |     PLA.  570  |
00003630  20 20 20 20 20 20 20 52  54 53 0d 20 20 35 38 30  |       RTS.  580|
00003640  20 2e 74 72 79 66 6f 75  72 0d 20 20 35 39 30 20  | .tryfour.  590 |
00003650  20 20 20 20 20 20 20 20  43 4d 50 20 23 34 0d 20  |        CMP #4. |
00003660  20 36 30 30 20 20 20 20  20 20 20 20 20 42 45 51  | 600         BEQ|
00003670  20 75 6e 72 65 63 6f 67  6e 69 73 65 64 0d 20 20  | unrecognised.  |
00003680  36 31 30 20 20 20 20 20  20 20 20 20 43 4d 50 20  |610         CMP |
00003690  23 36 0d 20 20 36 32 30  20 20 20 20 20 20 20 20  |#6.  620        |
000036a0  20 42 4e 45 20 6f 75 74  0d 20 20 36 33 30 20 20  | BNE out.  630  |
000036b0  20 20 20 20 20 20 20 54  58 41 0d 20 20 36 34 30  |       TXA.  640|
000036c0  20 20 20 20 20 20 20 20  20 50 48 41 0d 20 20 36  |         PHA.  6|
000036d0  35 30 20 20 20 20 20 20  20 20 20 54 59 41 0d 20  |50         TYA. |
000036e0  20 36 36 30 20 20 20 20  20 20 20 20 20 50 48 41  | 660         PHA|
000036f0  0d 20 20 36 37 30 20 20  20 20 20 20 20 20 20 4c  |.  670         L|
00003700  44 58 20 72 6f 6d 6e 75  6d 62 65 72 0d 20 20 36  |DX romnumber.  6|
00003710  38 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 77  |80         LDA w|
00003720  6f 72 6b 73 70 61 63 65  2c 58 0d 20 20 36 39 30  |orkspace,X.  690|
00003730  20 20 20 20 20 20 20 20  20 53 54 41 20 70 72 69  |         STA pri|
00003740  76 61 74 65 2b 31 0d 20  20 37 30 30 20 20 20 20  |vate+1.  700    |
00003750  20 20 20 20 20 4c 44 41  20 23 30 0d 20 20 37 31  |     LDA #0.  71|
00003760  30 20 20 20 20 20 20 20  20 20 53 54 41 20 70 72  |0         STA pr|
00003770  69 76 61 74 65 0d 20 20  37 32 30 20 20 20 20 20  |ivate.  720     |
00003780  20 20 20 20 4c 44 59 20  23 26 46 46 0d 20 20 37  |    LDY #&FF.  7|
00003790  33 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 28  |30         LDA (|
000037a0  70 72 69 76 61 74 65 29  2c 59 0d 20 20 37 34 30  |private),Y.  740|
000037b0  20 20 20 20 20 20 20 20  20 42 45 51 20 6e 6f 74  |         BEQ not|
000037c0  6f 6e 0d 20 20 37 35 30  20 20 20 20 20 20 20 20  |on.  750        |
000037d0  20 49 4e 59 0d 20 20 37  36 30 20 20 20 20 20 20  | INY.  760      |
000037e0  20 20 20 4c 44 41 20 28  65 72 72 6f 72 6e 75 6d  |   LDA (errornum|
000037f0  29 2c 59 0d 20 20 37 37  30 20 20 20 20 20 20 20  |),Y.  770       |
00003800  20 20 43 4d 50 20 23 26  42 45 20 20 20 20 20 20  |  CMP #&BE      |
00003810  5c 20 43 61 74 20 66 75  6c 6c 0d 20 20 37 38 30  |\ Cat full.  780|
00003820  20 20 20 20 20 20 20 20  20 42 45 51 20 63 68 61  |         BEQ cha|
00003830  6e 67 65 0d 20 20 37 39  30 20 20 20 20 20 20 20  |nge.  790       |
00003840  20 20 43 4d 50 20 23 26  43 36 20 20 20 20 20 20  |  CMP #&C6      |
00003850  5c 20 44 69 73 63 20 66  75 6c 6c 0d 20 20 38 30  |\ Disc full.  80|
00003860  30 20 20 20 20 20 20 20  20 20 42 45 51 20 63 68  |0         BEQ ch|
00003870  61 6e 67 65 0d 20 20 38  31 30 20 2e 6e 6f 74 6f  |ange.  810 .noto|
00003880  6e 0d 20 20 38 32 30 20  20 20 20 20 20 20 20 20  |n.  820         |
00003890  50 4c 41 0d 20 20 38 33  30 20 20 20 20 20 20 20  |PLA.  830       |
000038a0  20 20 54 41 59 0d 20 20  38 34 30 20 20 20 20 20  |  TAY.  840     |
000038b0  20 20 20 20 50 4c 41 0d  20 20 38 35 30 20 20 20  |    PLA.  850   |
000038c0  20 20 20 20 20 20 54 41  58 0d 20 20 38 36 30 20  |      TAX.  860 |
000038d0  2e 6f 75 74 0d 20 20 38  37 30 20 20 20 20 20 20  |.out.  870      |
000038e0  20 20 20 50 4c 41 0d 20  20 38 38 30 20 20 20 20  |   PLA.  880    |
000038f0  20 20 20 20 20 52 54 53  0d 20 20 38 39 30 20 2e  |     RTS.  890 .|
00003900  63 68 61 6e 67 65 0d 20  20 39 30 30 20 20 20 20  |change.  900    |
00003910  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00003920  20 20 20 5c 20 59 0d 20  20 39 31 30 20 20 20 20  |   \ Y.  910    |
00003930  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00003940  20 20 20 5c 20 58 0d 20  20 39 32 30 20 20 20 20  |   \ X.  920    |
00003950  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00003960  20 20 20 5c 20 41 0d 20  20 39 33 30 20 20 20 20  |   \ A.  930    |
00003970  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00003980  20 20 20 5c 20 53 74 61  74 75 73 20 72 65 67 69  |   \ Status regi|
00003990  73 74 65 72 0d 20 20 39  34 30 20 20 20 20 20 20  |ster.  940      |
000039a0  20 20 20 50 4c 41 20 20  20 20 20 20 20 20 20 20  |   PLA          |
000039b0  20 5c 20 52 65 74 75 72  6e 0d 20 20 39 35 30 20  | \ Return.  950 |
000039c0  20 20 20 20 20 20 20 20  50 4c 41 20 20 20 20 20  |        PLA     |
000039d0  20 20 20 20 20 20 5c 20  61 64 64 72 65 73 73 0d  |      \ address.|
000039e0  20 20 39 36 30 20 20 20  20 20 20 20 20 20 4c 44  |  960         LD|
000039f0  58 20 23 28 73 77 61 70  64 69 73 63 2b 64 69 66  |X #(swapdisc+dif|
00003a00  66 29 20 4d 4f 44 20 32  35 36 0d 20 20 39 37 30  |f) MOD 256.  970|
00003a10  20 20 20 20 20 20 20 20  20 4c 44 59 20 23 28 73  |         LDY #(s|
00003a20  77 61 70 64 69 73 63 2b  64 69 66 66 29 20 44 49  |wapdisc+diff) DI|
00003a30  56 20 32 35 36 0d 20 20  39 38 30 20 20 20 20 20  |V 256.  980     |
00003a40  20 20 20 20 4a 53 52 20  70 72 69 6e 74 2b 64 69  |    JSR print+di|
00003a50  66 66 0d 20 20 39 39 30  20 2e 73 70 61 63 65 62  |ff.  990 .spaceb|
00003a60  61 72 0d 20 31 30 30 30  20 20 20 20 20 20 20 20  |ar. 1000        |
00003a70  20 4c 44 41 20 23 26 37  41 0d 20 31 30 31 30 20  | LDA #&7A. 1010 |
00003a80  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 62 79  |        JSR osby|
00003a90  74 65 20 20 20 20 5c 20  53 63 61 6e 20 6b 65 79  |te    \ Scan key|
00003aa0  62 6f 61 72 64 0d 20 31  30 32 30 20 20 20 20 20  |board. 1020     |
00003ab0  20 20 20 20 43 50 58 20  23 26 36 32 0d 20 31 30  |    CPX #&62. 10|
00003ac0  33 30 20 20 20 20 20 20  20 20 20 42 4e 45 20 73  |30         BNE s|
00003ad0  70 61 63 65 62 61 72 20  20 5c 20 57 61 69 74 20  |pacebar  \ Wait |
00003ae0  66 6f 72 20 53 70 61 63  65 0d 20 31 30 34 30 20  |for Space. 1040 |
00003af0  20 20 20 20 20 20 20 20  4a 4d 50 20 61 6e 6f 74  |        JMP anot|
00003b00  68 65 72 2b 64 69 66 66  0d 20 31 30 35 30 20 2e  |her+diff. 1050 .|
00003b10  75 6e 72 65 63 6f 67 6e  69 73 65 64 0d 20 31 30  |unrecognised. 10|
00003b20  36 30 20 20 20 20 20 20  20 20 20 54 58 41 0d 20  |60         TXA. |
00003b30  31 30 37 30 20 20 20 20  20 20 20 20 20 50 48 41  |1070         PHA|
00003b40  0d 20 31 30 38 30 20 20  20 20 20 20 20 20 20 54  |. 1080         T|
00003b50  59 41 0d 20 31 30 39 30  20 20 20 20 20 20 20 20  |YA. 1090        |
00003b60  20 50 48 41 0d 20 31 31  30 30 20 20 20 20 20 20  | PHA. 1100      |
00003b70  20 20 20 4c 44 58 20 23  26 46 46 0d 20 31 31 31  |   LDX #&FF. 111|
00003b80  30 20 2e 63 6f 6d 6c 6f  6f 70 0d 20 31 31 32 30  |0 .comloop. 1120|
00003b90  20 20 20 20 20 20 20 20  20 49 4e 58 0d 20 31 31  |         INX. 11|
00003ba0  33 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 74  |30         LDA t|
00003bb0  69 74 6c 65 2b 64 69 66  66 2c 58 0d 20 31 31 34  |itle+diff,X. 114|
00003bc0  30 20 20 20 20 20 20 20  20 20 42 45 51 20 66 6f  |0         BEQ fo|
00003bd0  75 6e 64 0d 20 31 31 35  30 20 20 20 20 20 20 20  |und. 1150       |
00003be0  20 20 4c 44 41 20 28 63  6f 6d 76 65 63 29 2c 59  |  LDA (comvec),Y|
00003bf0  0d 20 31 31 36 30 20 20  20 20 20 20 20 20 20 49  |. 1160         I|
00003c00  4e 59 0d 20 31 31 37 30  20 20 20 20 20 20 20 20  |NY. 1170        |
00003c10  20 43 4d 50 20 23 41 53  43 28 22 2e 22 29 0d 20  | CMP #ASC("."). |
00003c20  31 31 38 30 20 20 20 20  20 20 20 20 20 42 45 51  |1180         BEQ|
00003c30  20 66 6f 75 6e 64 0d 20  31 31 39 30 20 20 20 20  | found. 1190    |
00003c40  20 20 20 20 20 41 4e 44  20 23 26 44 46 0d 20 31  |     AND #&DF. 1|
00003c50  32 30 30 20 20 20 20 20  20 20 20 20 43 4d 50 20  |200         CMP |
00003c60  74 69 74 6c 65 2b 64 69  66 66 2c 58 0d 20 31 32  |title+diff,X. 12|
00003c70  31 30 20 20 20 20 20 20  20 20 20 42 45 51 20 63  |10         BEQ c|
00003c80  6f 6d 6c 6f 6f 70 0d 20  31 32 32 30 20 20 20 20  |omloop. 1220    |
00003c90  20 20 20 20 20 50 4c 41  0d 20 31 32 33 30 20 20  |     PLA. 1230  |
00003ca0  20 20 20 20 20 20 20 54  41 59 0d 20 31 32 34 30  |       TAY. 1240|
00003cb0  20 20 20 20 20 20 20 20  20 50 4c 41 0d 20 31 32  |         PLA. 12|
00003cc0  35 30 20 20 20 20 20 20  20 20 20 54 41 58 0d 20  |50         TAX. |
00003cd0  31 32 36 30 20 20 20 20  20 20 20 20 20 50 4c 41  |1260         PLA|
00003ce0  0d 20 31 32 37 30 20 20  20 20 20 20 20 20 20 52  |. 1270         R|
00003cf0  54 53 0d 20 31 32 38 30  20 2e 66 6f 75 6e 64 0d  |TS. 1280 .found.|
00003d00  20 31 32 39 30 20 20 20  20 20 20 20 20 20 50 4c  | 1290         PL|
00003d10  41 0d 20 31 33 30 30 20  20 20 20 20 20 20 20 20  |A. 1300         |
00003d20  50 4c 41 0d 20 31 33 31  30 20 20 20 20 20 20 20  |PLA. 1310       |
00003d30  20 20 50 4c 41 0d 20 31  33 32 30 20 20 20 20 20  |  PLA. 1320     |
00003d40  20 20 20 20 4c 44 41 20  23 30 0d 20 31 33 33 30  |    LDA #0. 1330|
00003d50  20 20 20 20 20 20 20 20  20 54 41 58 0d 20 31 33  |         TAX. 13|
00003d60  34 30 20 20 20 20 20 20  20 20 20 54 41 59 0d 20  |40         TAY. |
00003d70  31 33 35 30 20 20 20 20  20 20 20 20 20 4a 53 52  |1350         JSR|
00003d80  20 6f 73 61 72 67 73 0d  20 31 33 36 30 20 20 20  | osargs. 1360   |
00003d90  20 20 20 20 20 20 43 4d  50 20 23 34 20 20 20 20  |      CMP #4    |
00003da0  20 20 20 20 5c 20 49 73  20 44 46 53 20 61 63 74  |    \ Is DFS act|
00003db0  69 76 65 3f 0d 20 31 33  37 30 20 20 20 20 20 20  |ive?. 1370      |
00003dc0  20 20 20 42 45 51 20 64  66 73 0d 20 31 33 38 30  |   BEQ dfs. 1380|
00003dd0  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 28 77  |         LDA #(w|
00003de0  72 6f 6e 67 2b 64 69 66  66 29 20 4d 4f 44 20 32  |rong+diff) MOD 2|
00003df0  35 36 0d 20 31 33 39 30  20 20 20 20 20 20 20 20  |56. 1390        |
00003e00  20 53 54 41 20 61 64 64  72 65 73 73 0d 20 31 34  | STA address. 14|
00003e10  30 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 23  |00         LDA #|
00003e20  28 77 72 6f 6e 67 2b 64  69 66 66 29 20 44 49 56  |(wrong+diff) DIV|
00003e30  20 32 35 36 0d 20 31 34  31 30 20 20 20 20 20 20  | 256. 1410      |
00003e40  20 20 20 53 54 41 20 61  64 64 72 65 73 73 2b 31  |   STA address+1|
00003e50  0d 20 31 34 32 30 20 20  20 20 20 20 20 20 20 4c  |. 1420         L|
00003e60  44 59 20 23 26 46 46 0d  20 31 34 33 30 20 2e 65  |DY #&FF. 1430 .e|
00003e70  72 72 6f 72 6c 6f 6f 70  0d 20 31 34 34 30 20 20  |rrorloop. 1440  |
00003e80  20 20 20 20 20 20 20 49  4e 59 0d 20 31 34 35 30  |       INY. 1450|
00003e90  20 20 20 20 20 20 20 20  20 4c 44 41 20 28 61 64  |         LDA (ad|
00003ea0  64 72 65 73 73 29 2c 59  0d 20 31 34 36 30 20 20  |dress),Y. 1460  |
00003eb0  20 20 20 20 20 20 20 53  54 41 20 65 72 72 73 74  |       STA errst|
00003ec0  61 63 6b 2c 59 0d 20 31  34 37 30 20 20 20 20 20  |ack,Y. 1470     |
00003ed0  20 20 20 20 42 50 4c 20  65 72 72 6f 72 6c 6f 6f  |    BPL errorloo|
00003ee0  70 0d 20 31 34 38 30 20  20 20 20 20 20 20 20 20  |p. 1480         |
00003ef0  4a 4d 50 20 65 72 72 73  74 61 63 6b 0d 20 31 34  |JMP errstack. 14|
00003f00  39 30 20 2e 64 66 73 0d  20 31 35 30 30 20 20 20  |90 .dfs. 1500   |
00003f10  20 20 20 20 20 20 4c 44  58 20 23 28 67 6f 2b 64  |      LDX #(go+d|
00003f20  69 66 66 29 20 4d 4f 44  20 32 35 36 0d 20 31 35  |iff) MOD 256. 15|
00003f30  31 30 20 20 20 20 20 20  20 20 20 4c 44 59 20 23  |10         LDY #|
00003f40  28 67 6f 2b 64 69 66 66  29 20 44 49 56 20 32 35  |(go+diff) DIV 25|
00003f50  36 0d 20 31 35 32 30 20  20 20 20 20 20 20 20 20  |6. 1520         |
00003f60  4a 53 52 20 70 72 69 6e  74 2b 64 69 66 66 0d 20  |JSR print+diff. |
00003f70  31 35 33 30 20 20 20 20  20 20 20 20 20 4a 53 52  |1530         JSR|
00003f80  20 6f 73 72 64 63 68 0d  20 31 35 34 30 20 20 20  | osrdch. 1540   |
00003f90  20 20 20 20 20 20 41 4e  44 20 23 26 44 46 0d 20  |      AND #&DF. |
00003fa0  31 35 35 30 20 20 20 20  20 20 20 20 20 50 48 41  |1550         PHA|
00003fb0  0d 20 31 35 36 30 20 20  20 20 20 20 20 20 20 4a  |. 1560         J|
00003fc0  53 52 20 6f 73 61 73 63  69 0d 20 31 35 37 30 20  |SR osasci. 1570 |
00003fd0  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 6e 65  |        JSR osne|
00003fe0  77 6c 0d 20 31 35 38 30  20 20 20 20 20 20 20 20  |wl. 1580        |
00003ff0  20 50 4c 41 0d 20 31 35  39 30 20 20 20 20 20 20  | PLA. 1590      |
00004000  20 20 20 43 4d 50 20 23  41 53 43 28 22 59 22 29  |   CMP #ASC("Y")|
00004010  0d 20 31 36 30 30 20 20  20 20 20 20 20 20 20 42  |. 1600         B|
00004020  45 51 20 79 65 73 0d 20  31 36 31 30 20 20 20 20  |EQ yes. 1610    |
00004030  20 20 20 20 20 4c 44 41  20 23 30 0d 20 31 36 32  |     LDA #0. 162|
00004040  30 20 20 20 20 20 20 20  20 20 52 54 53 0d 20 31  |0         RTS. 1|
00004050  36 33 30 20 2e 79 65 73  0d 20 31 36 34 30 20 20  |630 .yes. 1640  |
00004060  20 20 20 20 20 20 20 4a  53 52 20 6f 73 6e 65 77  |       JSR osnew|
00004070  6c 0d 20 31 36 35 30 20  20 20 20 20 20 20 20 20  |l. 1650         |
00004080  4c 44 58 20 72 6f 6d 6e  75 6d 62 65 72 0d 20 31  |LDX romnumber. 1|
00004090  36 36 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |660         LDA |
000040a0  77 6f 72 6b 73 70 61 63  65 2c 58 0d 20 31 36 37  |workspace,X. 167|
000040b0  30 20 20 20 20 20 20 20  20 20 53 54 41 20 62 6c  |0         STA bl|
000040c0  6f 63 6b 2b 31 0d 20 31  36 38 30 20 20 20 20 20  |ock+1. 1680     |
000040d0  20 20 20 20 53 54 41 20  63 6c 69 62 75 66 66 2b  |    STA clibuff+|
000040e0  31 0d 20 31 36 39 30 20  20 20 20 20 20 20 20 20  |1. 1690         |
000040f0  53 54 41 20 70 72 69 76  61 74 65 2b 31 0d 20 31  |STA private+1. 1|
00004100  37 30 30 20 20 20 20 20  20 20 20 20 53 54 41 20  |700         STA |
00004110  64 69 72 65 63 74 6f 72  79 2b 31 0d 20 31 37 31  |directory+1. 171|
00004120  30 20 20 20 20 20 20 20  20 20 43 4c 43 0d 20 31  |0         CLC. 1|
00004130  37 32 30 20 20 20 20 20  20 20 20 20 41 44 43 20  |720         ADC |
00004140  23 31 0d 20 31 37 33 30  20 20 20 20 20 20 20 20  |#1. 1730        |
00004150  20 53 54 41 20 63 61 74  62 75 66 66 2b 31 0d 20  | STA catbuff+1. |
00004160  31 37 34 30 20 20 20 20  20 20 20 20 20 4c 44 41  |1740         LDA|
00004170  20 23 26 38 30 0d 20 31  37 35 30 20 20 20 20 20  | #&80. 1750     |
00004180  20 20 20 20 53 54 41 20  62 6c 6f 63 6b 0d 20 31  |    STA block. 1|
00004190  37 36 30 20 20 20 20 20  20 20 20 20 4c 44 59 20  |760         LDY |
000041a0  23 38 0d 20 31 37 37 30  20 20 20 20 20 20 20 20  |#8. 1770        |
000041b0  20 53 54 59 20 63 61 74  62 75 66 66 0d 20 31 37  | STY catbuff. 17|
000041c0  38 30 20 20 20 20 20 20  20 20 20 49 4e 59 0d 20  |80         INY. |
000041d0  31 37 39 30 20 20 20 20  20 20 20 20 20 53 54 59  |1790         STY|
000041e0  20 64 69 72 65 63 74 6f  72 79 0d 20 31 38 30 30  | directory. 1800|
000041f0  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 30 0d  |         LDA #0.|
00004200  20 31 38 31 30 20 20 20  20 20 20 20 20 20 53 54  | 1810         ST|
00004210  41 20 70 72 69 76 61 74  65 0d 20 31 38 32 30 20  |A private. 1820 |
00004220  20 20 20 20 20 20 20 20  4c 44 41 20 23 26 46 46  |        LDA #&FF|
00004230  0d 20 31 38 33 30 20 20  20 20 20 20 20 20 20 54  |. 1830         T|
00004240  41 59 0d 20 31 38 34 30  20 20 20 20 20 20 20 20  |AY. 1840        |
00004250  20 53 54 41 20 28 70 72  69 76 61 74 65 29 2c 59  | STA (private),Y|
00004260  20 5c 20 26 46 46 20 3d  20 75 74 69 6c 69 74 79  | \ &FF = utility|
00004270  20 6f 6e 0d 20 31 38 35  30 20 20 20 20 20 20 20  | on. 1850       |
00004280  20 20 49 4e 59 20 20 20  20 20 20 20 20 20 20 20  |  INY           |
00004290  5c 20 59 3d 30 0d 20 31  38 36 30 20 2e 64 61 74  |\ Y=0. 1860 .dat|
000042a0  61 6c 6f 6f 70 0d 20 31  38 37 30 20 20 20 20 20  |aloop. 1870     |
000042b0  20 20 20 20 4c 44 41 20  64 61 74 61 2b 64 69 66  |    LDA data+dif|
000042c0  66 2c 59 0d 20 31 38 38  30 20 20 20 20 20 20 20  |f,Y. 1880       |
000042d0  20 20 53 54 41 20 28 62  6c 6f 63 6b 29 2c 59 0d  |  STA (block),Y.|
000042e0  20 31 38 39 30 20 20 20  20 20 20 20 20 20 49 4e  | 1890         IN|
000042f0  59 0d 20 31 39 30 30 20  20 20 20 20 20 20 20 20  |Y. 1900         |
00004300  43 50 59 20 23 26 41 0d  20 31 39 31 30 20 20 20  |CPY #&A. 1910   |
00004310  20 20 20 20 20 20 42 43  43 20 64 61 74 61 6c 6f  |      BCC datalo|
00004320  6f 70 0d 20 31 39 32 30  20 20 20 20 20 20 20 20  |op. 1920        |
00004330  20 4c 44 59 20 23 32 0d  20 31 39 33 30 20 20 20  | LDY #2. 1930   |
00004340  20 20 20 20 20 20 4c 44  41 20 63 61 74 62 75 66  |      LDA catbuf|
00004350  66 2b 31 0d 20 31 39 34  30 20 20 20 20 20 20 20  |f+1. 1940       |
00004360  20 20 53 54 41 20 28 62  6c 6f 63 6b 29 2c 59 0d  |  STA (block),Y.|
00004370  20 31 39 35 30 20 20 20  20 20 20 20 20 20 4c 44  | 1950         LD|
00004380  59 20 23 30 0d 20 31 39  36 30 20 2e 63 6f 70 79  |Y #0. 1960 .copy|
00004390  6c 6f 6f 70 0d 20 31 39  37 30 20 20 20 20 20 20  |loop. 1970      |
000043a0  20 20 20 4c 44 41 20 63  6f 70 79 2b 64 69 66 66  |   LDA copy+diff|
000043b0  2c 59 0d 20 31 39 38 30  20 20 20 20 20 20 20 20  |,Y. 1980        |
000043c0  20 53 54 41 20 28 70 72  69 76 61 74 65 29 2c 59  | STA (private),Y|
000043d0  0d 20 31 39 39 30 20 20  20 20 20 20 20 20 20 49  |. 1990         I|
000043e0  4e 59 0d 20 32 30 30 30  20 20 20 20 20 20 20 20  |NY. 2000        |
000043f0  20 43 50 59 20 23 26 42  0d 20 32 30 31 30 20 20  | CPY #&B. 2010  |
00004400  20 20 20 20 20 20 20 42  43 43 20 63 6f 70 79 6c  |       BCC copyl|
00004410  6f 6f 70 0d 20 32 30 32  30 20 20 20 20 20 20 20  |oop. 2020       |
00004420  20 20 53 54 59 20 63 6c  69 62 75 66 66 0d 20 32  |  STY clibuff. 2|
00004430  30 33 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |030         LDA |
00004440  23 26 37 46 0d 20 32 30  34 30 20 20 20 20 20 20  |#&7F. 2040      |
00004450  20 20 20 4c 44 58 20 62  6c 6f 63 6b 0d 20 32 30  |   LDX block. 20|
00004460  35 30 20 20 20 20 20 20  20 20 20 4c 44 59 20 62  |50         LDY b|
00004470  6c 6f 63 6b 2b 31 0d 20  32 30 36 30 20 20 20 20  |lock+1. 2060    |
00004480  20 20 20 20 20 4a 53 52  20 6f 73 77 6f 72 64 20  |     JSR osword |
00004490  20 20 20 5c 20 52 65 61  64 20 63 61 74 61 6c 6f  |   \ Read catalo|
000044a0  67 75 65 0d 20 32 30 37  30 20 2e 63 61 74 61 6c  |gue. 2070 .catal|
000044b0  6f 67 75 65 0d 20 32 30  38 30 20 20 20 20 20 20  |ogue. 2080      |
000044c0  20 20 20 4c 44 59 20 23  30 0d 20 32 30 39 30 20  |   LDY #0. 2090 |
000044d0  2e 74 72 61 6e 73 66 65  72 0d 20 32 31 30 30 20  |.transfer. 2100 |
000044e0  20 20 20 20 20 20 20 20  4c 44 41 20 28 63 61 74  |        LDA (cat|
000044f0  62 75 66 66 29 2c 59 0d  20 32 31 31 30 20 20 20  |buff),Y. 2110   |
00004500  20 20 20 20 20 20 53 54  41 20 28 63 6c 69 62 75  |      STA (clibu|
00004510  66 66 29 2c 59 0d 20 32  31 32 30 20 20 20 20 20  |ff),Y. 2120     |
00004520  20 20 20 20 49 4e 59 0d  20 32 31 33 30 20 20 20  |    INY. 2130   |
00004530  20 20 20 20 20 20 43 50  59 20 23 37 0d 20 32 31  |      CPY #7. 21|
00004540  34 30 20 20 20 20 20 20  20 20 20 42 43 43 20 74  |40         BCC t|
00004550  72 61 6e 73 66 65 72 0d  20 32 31 35 30 20 20 20  |ransfer. 2150   |
00004560  20 20 20 20 20 20 4c 44  41 20 23 26 44 0d 20 32  |      LDA #&D. 2|
00004570  31 36 30 20 20 20 20 20  20 20 20 20 53 54 41 20  |160         STA |
00004580  28 63 6c 69 62 75 66 66  29 2c 59 0d 20 32 31 37  |(clibuff),Y. 217|
00004590  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 28 63  |0         LDA (c|
000045a0  61 74 62 75 66 66 29 2c  59 0d 20 32 31 38 30 20  |atbuff),Y. 2180 |
000045b0  20 20 20 20 20 20 20 20  41 4e 44 20 23 26 37 46  |        AND #&7F|
000045c0  0d 20 32 31 39 30 20 20  20 20 20 20 20 20 20 43  |. 2190         C|
000045d0  4d 50 20 23 41 53 43 28  22 20 22 29 0d 20 32 32  |MP #ASC(" "). 22|
000045e0  30 30 20 20 20 20 20 20  20 20 20 42 43 43 20 66  |00         BCC f|
000045f0  69 6e 69 73 68 0d 20 32  32 31 30 20 20 20 20 20  |inish. 2210     |
00004600  20 20 20 20 4c 44 59 20  23 30 0d 20 32 32 32 30  |    LDY #0. 2220|
00004610  20 20 20 20 20 20 20 20  20 53 54 41 20 28 64 69  |         STA (di|
00004620  72 65 63 74 6f 72 79 29  2c 59 0d 20 32 32 33 30  |rectory),Y. 2230|
00004630  20 20 20 20 20 20 20 20  20 4c 44 41 20 63 61 74  |         LDA cat|
00004640  62 75 66 66 0d 20 32 32  34 30 20 20 20 20 20 20  |buff. 2240      |
00004650  20 20 20 43 4c 43 0d 20  32 32 35 30 20 20 20 20  |   CLC. 2250    |
00004660  20 20 20 20 20 41 44 43  20 23 38 0d 20 32 32 36  |     ADC #8. 226|
00004670  30 20 20 20 20 20 20 20  20 20 53 54 41 20 63 61  |0         STA ca|
00004680  74 62 75 66 66 0d 20 32  32 37 30 20 2e 61 6e 6f  |tbuff. 2270 .ano|
00004690  74 68 65 72 0d 20 32 32  38 30 20 20 20 20 20 20  |ther. 2280      |
000046a0  20 20 20 4c 44 58 20 23  30 0d 20 32 32 39 30 20  |   LDX #0. 2290 |
000046b0  20 20 20 20 20 20 20 20  4c 44 59 20 63 6c 69 62  |        LDY clib|
000046c0  75 66 66 2b 31 0d 20 32  33 30 30 20 20 20 20 20  |uff+1. 2300     |
000046d0  20 20 20 20 4a 53 52 20  6f 73 63 6c 69 0d 20 32  |    JSR oscli. 2|
000046e0  33 31 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |310         LDA |
000046f0  63 61 74 62 75 66 66 0d  20 32 33 32 30 20 20 20  |catbuff. 2320   |
00004700  20 20 20 20 20 20 42 4e  45 20 63 61 74 61 6c 6f  |      BNE catalo|
00004710  67 75 65 0d 20 32 33 33  30 20 2e 66 69 6e 69 73  |gue. 2330 .finis|
00004720  68 0d 20 32 33 34 30 20  20 20 20 20 20 20 20 20  |h. 2340         |
00004730  4c 44 41 20 23 30 0d 20  32 33 35 30 20 20 20 20  |LDA #0. 2350    |
00004740  20 20 20 20 20 4c 44 59  20 23 26 46 46 0d 20 32  |     LDY #&FF. 2|
00004750  33 36 30 20 20 20 20 20  20 20 20 20 53 54 41 20  |360         STA |
00004760  28 70 72 69 76 61 74 65  29 2c 59 20 5c 20 30 20  |(private),Y \ 0 |
00004770  3d 20 75 74 69 6c 69 74  79 20 6f 66 66 0d 20 32  |= utility off. 2|
00004780  33 37 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |370         JSR |
00004790  6f 73 6e 65 77 6c 0d 20  32 33 38 30 20 20 20 20  |osnewl. 2380    |
000047a0  20 20 20 20 20 4c 44 41  20 23 26 46 0d 20 32 33  |     LDA #&F. 23|
000047b0  39 30 20 20 20 20 20 20  20 20 20 4c 44 58 20 23  |90         LDX #|
000047c0  30 0d 20 32 34 30 30 20  20 20 20 20 20 20 20 20  |0. 2400         |
000047d0  4a 53 52 20 6f 73 62 79  74 65 20 20 20 20 5c 20  |JSR osbyte    \ |
000047e0  46 6c 75 73 68 20 62 75  66 66 65 72 73 0d 20 32  |Flush buffers. 2|
000047f0  34 31 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |410         LDA |
00004800  23 26 42 42 0d 20 32 34  32 30 20 20 20 20 20 20  |#&BB. 2420      |
00004810  20 20 20 4c 44 58 20 23  30 0d 20 32 34 33 30 20  |   LDX #0. 2430 |
00004820  20 20 20 20 20 20 20 20  4c 44 59 20 23 26 46 46  |        LDY #&FF|
00004830  0d 20 32 34 34 30 20 20  20 20 20 20 20 20 20 4a  |. 2440         J|
00004840  53 52 20 6f 73 62 79 74  65 20 20 20 20 5c 20 46  |SR osbyte    \ F|
00004850  69 6e 64 20 42 41 53 49  43 0d 20 32 34 35 30 20  |ind BASIC. 2450 |
00004860  20 20 20 20 20 20 20 20  4c 44 41 20 23 26 38 45  |        LDA #&8E|
00004870  0d 20 32 34 36 30 20 20  20 20 20 20 20 20 20 4a  |. 2460         J|
00004880  4d 50 20 6f 73 62 79 74  65 20 20 20 20 5c 20 45  |MP osbyte    \ E|
00004890  6e 74 65 72 20 42 41 53  49 43 0d 20 32 34 37 30  |nter BASIC. 2470|
000048a0  20 2e 70 72 69 6e 74 0d  20 32 34 38 30 20 20 20  | .print. 2480   |
000048b0  20 20 20 20 20 20 53 54  58 20 61 64 64 72 65 73  |      STX addres|
000048c0  73 0d 20 32 34 39 30 20  20 20 20 20 20 20 20 20  |s. 2490         |
000048d0  53 54 59 20 61 64 64 72  65 73 73 2b 31 0d 20 32  |STY address+1. 2|
000048e0  35 30 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |500         LDA |
000048f0  23 26 46 0d 20 32 35 31  30 20 20 20 20 20 20 20  |#&F. 2510       |
00004900  20 20 4c 44 58 20 23 30  0d 20 32 35 32 30 20 20  |  LDX #0. 2520  |
00004910  20 20 20 20 20 20 20 4a  53 52 20 6f 73 62 79 74  |       JSR osbyt|
00004920  65 20 20 20 20 5c 20 46  6c 75 73 68 20 62 75 66  |e    \ Flush buf|
00004930  66 65 72 73 0d 20 32 35  33 30 20 20 20 20 20 20  |fers. 2530      |
00004940  20 20 20 4c 44 59 20 23  30 0d 20 32 35 34 30 20  |   LDY #0. 2540 |
00004950  2e 70 72 69 6e 74 6c 6f  6f 70 0d 20 32 35 35 30  |.printloop. 2550|
00004960  20 20 20 20 20 20 20 20  20 4c 44 41 20 28 61 64  |         LDA (ad|
00004970  64 72 65 73 73 29 2c 59  0d 20 32 35 36 30 20 20  |dress),Y. 2560  |
00004980  20 20 20 20 20 20 20 42  45 51 20 65 6e 64 70 72  |       BEQ endpr|
00004990  69 6e 74 0d 20 32 35 37  30 20 20 20 20 20 20 20  |int. 2570       |
000049a0  20 20 4a 53 52 20 6f 73  61 73 63 69 0d 20 32 35  |  JSR osasci. 25|
000049b0  38 30 20 20 20 20 20 20  20 20 20 49 4e 59 0d 20  |80         INY. |
000049c0  32 35 39 30 20 20 20 20  20 20 20 20 20 4a 4d 50  |2590         JMP|
000049d0  20 70 72 69 6e 74 6c 6f  6f 70 2b 64 69 66 66 0d  | printloop+diff.|
000049e0  20 32 36 30 30 20 2e 65  6e 64 70 72 69 6e 74 0d  | 2600 .endprint.|
000049f0  20 32 36 31 30 20 20 20  20 20 20 20 20 20 52 54  | 2610         RT|
00004a00  53 0d 20 32 36 32 30 20  2e 64 61 74 61 0d 20 32  |S. 2620 .data. 2|
00004a10  36 33 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |630         OPT |
00004a20  46 4e 65 71 75 64 28 26  46 46 30 30 30 30 30 30  |FNequd(&FF000000|
00004a30  29 0d 20 32 36 34 30 20  20 20 20 20 20 20 20 20  |). 2640         |
00004a40  4f 50 54 20 46 4e 65 71  75 64 28 26 30 30 35 33  |OPT FNequd(&0053|
00004a50  30 33 46 46 29 0d 20 32  36 35 30 20 20 20 20 20  |03FF). 2650     |
00004a60  20 20 20 20 4f 50 54 20  46 4e 65 71 75 77 28 26  |    OPT FNequw(&|
00004a70  32 31 30 30 29 0d 20 32  36 36 30 20 2e 63 6f 70  |2100). 2660 .cop|
00004a80  79 0d 20 32 36 37 30 20  20 20 20 20 20 20 20 20  |y. 2670         |
00004a90  4f 50 54 20 46 4e 65 71  75 73 28 22 43 4f 50 59  |OPT FNequs("COPY|
00004aa0  20 30 20 31 20 2a 2e 22  29 0d 20 32 36 38 30 20  | 0 1 *."). 2680 |
00004ab0  2e 73 77 61 70 64 69 73  63 0d 20 32 36 39 30 20  |.swapdisc. 2690 |
00004ac0  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00004ad0  75 77 28 26 30 37 30 44  29 0d 20 32 37 30 30 20  |uw(&070D). 2700 |
00004ae0  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00004af0  75 73 28 22 49 6e 73 65  72 74 20 61 20 6e 65 77  |us("Insert a new|
00004b00  20 64 69 73 63 20 69 6e  20 22 29 0d 20 32 37 31  | disc in "). 271|
00004b10  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00004b20  65 71 75 62 28 26 33 41  29 0d 20 32 37 32 30 20  |equb(&3A). 2720 |
00004b30  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00004b40  75 73 28 22 31 22 29 0d  20 32 37 33 30 20 20 20  |us("1"). 2730   |
00004b50  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 62  |      OPT FNequb|
00004b60  28 26 30 44 29 0d 20 32  37 34 30 20 20 20 20 20  |(&0D). 2740     |
00004b70  20 20 20 20 4f 50 54 20  46 4e 65 71 75 73 28 22  |    OPT FNequs("|
00004b80  61 6e 64 20 70 72 65 73  73 20 74 68 65 20 53 70  |and press the Sp|
00004b90  61 63 65 20 42 61 72 22  29 0d 20 32 37 35 30 20  |ace Bar"). 2750 |
00004ba0  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00004bb0  75 77 28 26 30 44 30 44  29 0d 20 32 37 36 30 20  |uw(&0D0D). 2760 |
00004bc0  20 20 20 20 20 20 20 20  42 52 4b 0d 20 32 37 37  |        BRK. 277|
00004bd0  30 20 2e 67 6f 0d 20 32  37 38 30 20 20 20 20 20  |0 .go. 2780     |
00004be0  20 20 20 20 4f 50 54 20  46 4e 65 71 75 73 28 22  |    OPT FNequs("|
00004bf0  43 6f 70 79 20 61 6c 6c  20 66 69 6c 65 73 20 66  |Copy all files f|
00004c00  72 6f 6d 20 22 29 0d 20  32 37 39 30 20 20 20 20  |rom "). 2790    |
00004c10  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
00004c20  26 33 41 29 0d 20 32 38  30 30 20 20 20 20 20 20  |&3A). 2800      |
00004c30  20 20 20 4f 50 54 20 46  4e 65 71 75 73 28 22 30  |   OPT FNequs("0|
00004c40  20 74 6f 20 22 29 0d 20  32 38 31 30 20 20 20 20  | to "). 2810    |
00004c50  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
00004c60  26 33 41 29 0d 20 32 38  32 30 20 20 20 20 20 20  |&3A). 2820      |
00004c70  20 20 20 4f 50 54 20 46  4e 65 71 75 73 28 22 31  |   OPT FNequs("1|
00004c80  22 29 0d 20 32 38 33 30  20 20 20 20 20 20 20 20  |"). 2830        |
00004c90  20 4f 50 54 20 46 4e 65  71 75 62 28 26 30 44 29  | OPT FNequb(&0D)|
00004ca0  0d 20 32 38 34 30 20 20  20 20 20 20 20 20 20 4f  |. 2840         O|
00004cb0  50 54 20 46 4e 65 71 75  73 28 22 47 6f 20 28 59  |PT FNequs("Go (Y|
00004cc0  2f 4e 29 20 3f 20 22 29  0d 20 32 38 35 30 20 20  |/N) ? "). 2850  |
00004cd0  20 20 20 20 20 20 20 42  52 4b 0d 20 32 38 36 30  |       BRK. 2860|
00004ce0  20 2e 77 72 6f 6e 67 0d  20 32 38 37 30 20 20 20  | .wrong. 2870   |
00004cf0  20 20 20 20 20 20 42 52  4b 0d 20 32 38 38 30 20  |      BRK. 2880 |
00004d00  20 20 20 20 20 20 20 20  42 52 4b 0d 20 32 38 39  |        BRK. 289|
00004d10  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00004d20  65 71 75 73 28 22 44 46  53 20 6e 6f 74 20 61 63  |equs("DFS not ac|
00004d30  74 69 76 65 22 29 0d 20  32 39 30 30 20 20 20 20  |tive"). 2900    |
00004d40  20 20 20 20 20 42 52 4b  0d 20 32 39 31 30 20 20  |     BRK. 2910  |
00004d50  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00004d60  62 28 26 46 46 29 0d 20  32 39 32 30 20 2e 6c 61  |b(&FF). 2920 .la|
00004d70  73 74 62 79 74 65 0d 20  32 39 33 30 20 5d 0d 20  |stbyte. 2930 ]. |
00004d80  32 39 34 30 20 4e 45 58  54 0d 20 32 39 35 30 20  |2940 NEXT. 2950 |
00004d90  49 4e 50 55 54 27 22 53  61 76 65 20 66 69 6c 65  |INPUT'"Save file|
00004da0  6e 61 6d 65 20 3d 20 22  66 69 6c 65 6e 61 6d 65  |name = "filename|
00004db0  24 0d 20 32 39 36 30 20  49 46 20 66 69 6c 65 6e  |$. 2960 IF filen|
00004dc0  61 6d 65 24 3d 22 22 20  45 4e 44 0d 20 32 39 37  |ame$="" END. 297|
00004dd0  30 20 24 73 61 76 65 3d  22 53 41 56 45 20 22 2b  |0 $save="SAVE "+|
00004de0  66 69 6c 65 6e 61 6d 65  24 2b 22 20 22 2b 53 54  |filename$+" "+ST|
00004df0  52 24 7e 28 48 49 4d 45  4d 29 2b 22 20 22 2b 53  |R$~(HIMEM)+" "+S|
00004e00  54 52 24 7e 28 6c 61 73  0d 20 20 20 20 20 20 74  |TR$~(las.      t|
00004e10  62 79 74 65 29 2b 22 20  46 46 46 46 38 30 30 30  |byte)+" FFFF8000|
00004e20  20 46 46 46 46 38 30 30  30 22 0d 20 32 39 38 30  | FFFF8000". 2980|
00004e30  20 58 25 3d 73 61 76 65  20 4d 4f 44 20 32 35 36  | X%=save MOD 256|
00004e40  0d 20 32 39 39 30 20 59  25 3d 73 61 76 65 20 44  |. 2990 Y%=save D|
00004e50  49 56 20 32 35 36 0d 20  33 30 30 30 20 2a 4f 50  |IV 256. 3000 *OP|
00004e60  54 31 2c 32 0d 20 33 30  31 30 20 43 41 4c 4c 20  |T1,2. 3010 CALL |
00004e70  6f 73 63 6c 69 0d 20 33  30 32 30 20 2a 4f 50 54  |oscli. 3020 *OPT|
00004e80  31 2c 30 0d 20 33 30 33  30 20 45 4e 44 0d 20 33  |1,0. 3030 END. 3|
00004e90  30 34 30 20 44 45 46 46  4e 65 71 75 62 28 62 79  |040 DEFFNequb(by|
00004ea0  74 65 29 0d 20 33 30 35  30 20 3f 50 25 3d 62 79  |te). 3050 ?P%=by|
00004eb0  74 65 0d 20 33 30 36 30  20 50 25 3d 50 25 2b 31  |te. 3060 P%=P%+1|
00004ec0  0d 20 33 30 37 30 20 3d  70 61 73 73 0d 20 33 30  |. 3070 =pass. 30|
00004ed0  38 30 20 44 45 46 46 4e  65 71 75 77 28 77 6f 72  |80 DEFFNequw(wor|
00004ee0  64 29 0d 20 33 30 39 30  20 3f 50 25 3d 77 6f 72  |d). 3090 ?P%=wor|
00004ef0  64 20 4d 4f 44 20 32 35  36 0d 20 33 31 30 30 20  |d MOD 256. 3100 |
00004f00  50 25 3f 31 3d 77 6f 72  64 20 44 49 56 20 32 35  |P%?1=word DIV 25|
00004f10  36 0d 20 33 31 31 30 20  50 25 3d 50 25 2b 32 0d  |6. 3110 P%=P%+2.|
00004f20  20 33 31 32 30 20 3d 70  61 73 73 0d 20 33 31 33  | 3120 =pass. 313|
00004f30  30 20 44 45 46 46 4e 65  71 75 64 28 64 6f 75 62  |0 DEFFNequd(doub|
00004f40  6c 65 29 0d 20 33 31 34  30 20 21 50 25 3d 64 6f  |le). 3140 !P%=do|
00004f50  75 62 6c 65 0d 20 33 31  35 30 20 50 25 3d 50 25  |uble. 3150 P%=P%|
00004f60  2b 34 0d 20 33 31 36 30  20 3d 70 61 73 73 0d 20  |+4. 3160 =pass. |
00004f70  33 31 37 30 20 44 45 46  46 4e 65 71 75 73 28 73  |3170 DEFFNequs(s|
00004f80  74 72 69 6e 67 24 29 0d  20 33 31 38 30 20 24 50  |tring$). 3180 $P|
00004f90  25 3d 73 74 72 69 6e 67  24 0d 20 33 31 39 30 20  |%=string$. 3190 |
00004fa0  50 25 3d 50 25 2b 4c 45  4e 28 73 74 72 69 6e 67  |P%=P%+LEN(string|
00004fb0  24 29 0d 20 33 32 30 30  20 3d 70 61 73 73 0d     |$). 3200 =pass.|
00004fbf
22-01-88/T\SWR13.m0
22-01-88/T\SWR13.m1
22-01-88/T\SWR13.m2
22-01-88/T\SWR13.m4
22-01-88/T\SWR13.m5