Home » CEEFAX disks » telesoftware8.adl » 13-08-88/T\DFS01
13-08-88/T\DFS01
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 » telesoftware8.adl |
Filename: | 13-08-88/T\DFS01 |
Read OK: | ✔ |
File size: | 6682 bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
The Acorn DFS Osword commands - by - Gordon Horsington ---------------------------------------------------------- Module 1. The DFS Osword commands (part 1) ------------------------------------------ +----------------------------------------------------------+ | All the DFS modules in this series use programs which | | experiment with the format and contents of discs. These | | experiments may have disasterous effects if you use any | | of the programs on discs which store programs or data | | which you cannot afford to lose. You should first try | | out the programs using discs that have either been | | duplicated or, better still, have not been used at all. | +----------------------------------------------------------+ The DFS ROM intercepts and recognises three Osword calls. Osword &7D reads the number of times a disk has been written, Osword &7E reads the number of sectors on a disc, and Osword &7F executes the 8271 disc controller commands. ---------- Osword &7D ---------- Osword &7D reads the catalogue for the current default disc, as specified by the most recent *DRIVE command, and extracts the number of disc cycles from the catalogue. The number of disc cycles is a BCD number in the range from 0 to 99. This number gives some indication of how many times the disc has been written. Because The disc cycle number restarts at 0 after reaching 99 this is not a reliable count. The catalogue is read by Osword &7D and stored in the first two pages of the paged ROM absolute workspace (pages &0E and &0F with OS 1.2). The result is stored in a one byte parameter block specified by X and Y registers on entry. The program CYCLES demonstrates how Osword &7D can be used to read the disc cycles. 10 REM: CYCLES 20 osword=&FFF1 30 DIM mcode &100 40 FOR pass = 0 TO 2 STEP 2 50 P%=mcode 60 [ OPT pass 70 LDA #&7D 80 LDX #result MOD 256 90 LDY #result DIV 256 100 JSR osword 110 RTS 120 .result 130 EQUB &00 140 ] 150 NEXT 160 CALL mcode 170 PRINT"Disc cycles = ";~?result ---------- Osword &7E ---------- Osword &7E reads the catalogue for the current default disc, as specified by the most recent *DRIVE command, and extracts the number of sectors available on the disc. There are 800 (&320) sectors on an 80 track Acorn DFS disc and 400 (&190) sectors on a 40 track Acorn DFS disc. Non-standard and copy-protected discs may have different numbers of available sectors. The catalogue is read by Osword &7E and stored in the first two pages of the paged ROM absolute workspace (pages &0E and &0F with OS 1.2). The result is stored in a four byte parameter block specified by the X and Y registers on entry. The program HOWMANY demonstrates how Osword &7E can be used to read the number of available sectors on a DFS disc. The least significant byte of the number of sectors will be in byte &01 of the result and the most significant byte in byte &02 of the result. Bytes &00 and &03 of the result should always be zero. 10 REM: HOWMANY 20 osword=&FFF1 30 DIM mcode &100 40 FOR pass = 0 TO 2 STEP 2 50 P%=mcode 60 [ OPT pass 70 LDA #&7E 80 LDX #result MOD 256 90 LDY #result DIV 256 100 JSR osword 110 RTS 120 .result 130 EQUD &00 140 ] 150 NEXT 160 CALL mcode 170 PRINT"&";~result?2;~result?1;" Sectors" ---------- Osword &7F ---------- Osword &7F executes the 8271 disc controller commands. If the disc interface uses a 1770 disc controller then Osword &7F emulates the 8271 command set using the 1770. The complete command set executed by Osword &7F is shown in figure 1. Not all the 8271 commands can be emulated by the 1770 and the Osword &7F commands from &6C to &7D are not fully implemented with the Acorn 1770 disc interface. When you write software which uses the Osword &7F commands from &6C to &7D you should take care to ensure that your programs will work with the 1770 disc controller as well as with the 8271 interface. Some of the example programs used in this module use these partly implemented Osword &7F commands and may not work as expected with all 1770 disc interfaces. The programs used to illustrate the other Osword &7F commands all work with the Acorn 1770 DFS. +---------+--------+------+-------------------------------------------+ | Command | Param- | 1770 | Action | | number | eters | | | +---------+--------+------+-------------------------------------------+ | &4A | 2 | Yes | Write data 128 bytes | | &4B | 3 | Yes | Write data multi-sector | | &4E | 2 | Yes | Write deleted data 128 bytes | | &4F | 3 | Yes | Write deleted data multi-sector | | &52 | 2 | Yes | Read data 128 bytes | | &53 | 3 | Yes | Read data multi-sector | | &56 | 2 | Yes | Read data and deleted data 128 bytes | | &57 | 3 | Yes | Read data and deleted data multi-sector | | &5B | 3 | Yes | Read sector ids | | &5E | 2 | Yes | Verify data and deleted data 128 bytes | | &5F | 3 | Yes | Verify data and deleted data multi-sector | | &63 | 5 | Yes | Format track | | &69 | 1 | Yes | Seek | +---------+--------+------+-------------------------------------------+ | &6C | 0 | Part | Read drive status | | &75 | 4 | Part | Initialise 8271 | | &75 | 4 | Part | Load bad tracks | | &7A | 2 | Part | Write special register | | &7D | 1 | Part | Read special register | +---------+--------+------+-------------------------------------------+ Figure 1. The Osword &7F command set ------------------------------------ Osword &7F uses a variable length parameter block the address of which is specified by the X and Y registers on entry. Byte &00 of the parameter block is used to store the number of the disc drive to be used with the command. If a negative drive number is used (&80 to &FF) then Osword &7F uses the currently selected drive as specified by the most recent *DRIVE command. Bytes &01 to &04 of the parameter block store the address of a buffer area into which any data to be read will be placed, or from which any data to be written will be taken. A buffer is not needed by all the commands but bytes &01 to &04 of the parameter block are always assigned to a buffer address even if a buffer is not used. Column 2 of figure 1 shows that the Osword &7F commands use from 0 to 5 parameters. The number of parameters used by a call is stored in byte &05 of its parameter block. Byte &06 of the parameter block stores the command number (column 1, figure 1), and byte &07 onwards the parameters required by the command. The last byte of the parameter block is a result byte. Unless it is used to read the 8271 registers, Osword &7F will normally return the number zero in the result byte when a command has been executed sucessfully but it returns the number &20 (ie. bit 5 set) if deleted data have been sucessfully written to, read from, or verified on a disc. The result is returned in byte &07 of the parameter block for Osword &7F command number &6C, which uses no parameters. It is returned in byte &08 of the parameter block for command numbers &69 and &7D, which use one parameter, and so on up to byte &0C of the parameter block for command number &63 which uses 5 parameters. Errors are reported in bits 1 to 4 of the result byte. The error codes can be isolated by ANDing the result byte with #&1E and the error codes can be interpreted as shown in figure 2. +--------+----------------------------+ | Result | Interpretation | +--------+----------------------------+ | &02 | Scan met equal ** | | &04 | Scan met not equal ** | | &08 | Clock error | | &0A | Late DMA ** | | &0C | Sector ID CRC error | | &0E | Data CRC error | | &10 | Drive not ready | | &12 | Disc write protected | | &14 | Physical track 0 not found | | &16 | Write fault | | &18 | Sector not found | +--------+----------------------------+ | Errors marked ** should not occur | +-------------------------------------+ Figure 2. The error codes returned in the result byte ----------------------------------------------------- When designing software which uses Osword &7F you can test the result byte for specific errors after ANDing the result with #&1E to isolate the error bits. ANDing with #&1E excludes the deleted data bit which is not really an error at all. Testing for specific errors is not essential because all the above errors are fatal and any error should be used to halt your program. Testing for specific errors can always give some useful extra information when a routine fails to work as expected. In the rest of this module and whole of the next module I will discuss the commands executed by Osword &7F and give short examples of the some of them. Later in the series these commands will be used to show you how to create disc utility programs. The order in which the commands will be discussed is not the order in which they are listed in figure 1. I will cover the Osword &7F command numbers &69 to &7D in this module. With the exception of the Seek command, these commands are not fuly implemented with the 1770 disc interface but they are effectivly incorporated in other commands such as Write Data, Read Data, and Verify. The Osword &7F command numbers &4A to &63 will be covered in the next module. ---------------------------- Osword &7F Read Drive Status ---------------------------- The Osword &7F Read Drive Status command copies the 8271 drive control input register to the parameter block result byte. To use this command set up the following parameter block. Parameter block &00 = drive number (&00-&03 or &FF) Parameter block &01 - &04 = buffer address (not used) Parameter block &05 = &00 (no command parameters) Parameter block &06 = &6C (read drive status command) Parameter block &07 = result byte Each bit of the result byte has the following meaning: bit 7 = unused bit 6 = READY1 bit 5 = FAULT bit 4 = INDEX bit 3 = WR PROTECT bit 2 = READY0 bit 1 = TRK0 bit 0 = COUNT/OP1 These results are only really useful for tracking down hardware errors. You can use the demonstration program STATUS with both write protected and write enabled discs to see the effect that write protection has on the bits of the result register. You could use this command to test for a write protection tab on a disc but the only unique use for the Osword &7F Read Drive Status command is to clear a "not ready" signal. It is used by the DFS for this purpose. This is not one of the most useful commands and you will probably not need to use it in any of your programs. 10 REM: STATUS 20 oswrch=&FFEE 30 osword=&FFF1 40 DIM mcode &100 50 FOR pass = 0 TO 2 STEP 2 60 P%=mcode 70 [ OPT pass 80 LDA #&7F 90 LDX #block MOD 256 100 LDY #block DIV 256 110 JSR osword 120 RTS 130 .block 140 EQUB &FF \ current drive 150 EQUD &00 \ does not matter 160 EQUB &00 \ 0 parameters 170 EQUB &6C \ read status command 180 .result 190 EQUB &00 \ result byte 200 .binary 210 LDX #8 220 .loop 230 LDA #ASC("0") 240 ASL result 250 ADC #&00 260 JSR oswrch 270 DEX 280 BNE loop 290 RTS 300 ] 310 NEXT 320 CALL mcode 330 PRINT"Result = &";~?result;", %"; 340 CALL binary 350 PRINT -------------------------- Osword &7F Initialise 8271 -------------------------- Osword &7F Initialise 8271 is not fully implemented with the 1770 disc interface. For this reason you should avoid using it and use the equivalent Osbyte &FF which is available from the operating system of all BBC microcomputers. The hardware default setting is equivalent to *FX 255,0,255 and this gives access to the slowest disc drives. The Osbyte calls in figure 3 can be used to give access to faster drives but, if you are writing software to be used on unknown drives, it may be a good idea to select the slowest time. Osbyte &FF passes the values of the drive step time, settlement time, and head load time to the disc controller on soft break and they will remain in force until a hard break. +-----------+-------------+-----------+---------------+ | Step time | Settle time | Load time | Osbyte &FF | +-----------+-------------+-----------+---------------+ | 4 | 16 | 0 | *FX 255,0,207 | | 6 | 16 | 0 | *FX 255,0,223 | | 6 | 50 | 32 | *FX 255,0,239 | | 24 | 20 | 64 | *FX 255,0,255 | +-----------+-------------+-----------+---------------+ Figure 3. Disc access timings ----------------------------- If you need to use the Osword &7F Initialise 8271 command then the following parameter block must be used. Parameter block &00 = drive number (&00-&03 or &FF) Parameter block &01 - &04 = buffer address (not used) Parameter block &05 = &04 (4 command parameters) Parameter block &06 = &75 (initialise 8271 command) Parameter block &07 = &0D (init 8271 marker) Parameter block &08 = drive step time (milliseconds / 2) Parameter block &09 = head settlement time (miliseconds / 2) Parameter block &0A = head unload/load time (two 4 bit numbers) Parameter block &0B = result byte The drive step time should be in the range from &01 to &FF, representing 2 to 510 milliseconds in 2 millisecond steps. A drive step time of zero indicates that the drive will provide its own step pulses. The head settlement time should be in the range &00 to &FF representing a delay of 0 to 512 miliseconds in 2 millisecond steps. The four most significant bits of the head unload/load time should be in the range %0000 to %1110 (0-14) representing the number of complete disc revolutions before the head is unloaded. %1111 specifies that the head should not be unloaded at all. The four least significant bits of the head unload/load time specify the time taken to load the head in 8 milisecond intervals. This is a number in the range %0000 to %1111 (0-15) representing head load times of 0 to 120 milliseconds. The following code could be used to initialise the 8271. LDA #&7F LDX #block MOD 256 LDY #block DIV 256 JSR &FFF1 RTS .block EQUB &FF \ current drive EQUD &00 \ buffer address (not used) EQUB &04 \ 4 parameters EQUB &75 \ init 8271 command EQUB 12 \ 24 milliseconds step time EQUB 10 \ 20 milliseconds settle time EQUB &C8 \ Unload = 12 revs, load =64 milliseconds EQUB &00 \ result byte --------------- Osword &7F Seek --------------- The Osword &7F Seek command uses the appropriate track register as a base from which to seek a specified physical track. Register number &12 is used for drive 0/2 and register number &1A is used for drive 1/3. This command does not load the head and does not check the sector IDs. If track 0 is specified the seek command steps the head outwards until it trips the track 0 switch. If the TRK0 signal is missing after 255 attempts to find it, the command reports error &14 in the result byte. Error &14 is physical track zero not found (see figure 2). Seek track 0 can be used to find a base from which to seek any other physical track. This can be useful if the track register contains an unknown or incorrect physical track number. The following parameter block is used to seek a physical track. Parameter block &00 = drive number (&00-&03 or &FF) Parameter block &01 - &04 = buffer address (not used) Parameter block &05 = &01 (1 command parameter) Parameter block &06 = &69 (seek command) Parameter block &07 = physical track number Parameter block &08 = result byte The Osword &7F Seek command is useful if, for example, you want to write data onto a copy-protected disc which uses different physical and logical track numbers. You would use it to seek the physical track number and then use the Osword &7F Write Special Register command to write the logical track number into the appropriate track register. After writing to the disc you should then either rewrite the physical track number into the appropriate track register or seek track 0. The following code could be used to seek track 0 on the current drive. LDA #&7F LDX #block MOD 256 LDY #block DIV 256 JSR &FFF1 RTS .block EQUB &FF \ current drive EQUD &00 \ buffer address (not used) EQUB &01 \ 1 parameter EQUB &69 \ seek command EQUB &00 \ track 0 EQUB &00 \ result byte -------------------------- Osword &7F Load Bad Tracks -------------------------- This command is used to tell the 8271 that there are one or two "bad tracks" on a disc. This command is not fully implemented in the 1770 disc interface and is not used by either DFS. Because it is not used by the DFS it can be used for copy-protecting discs when the DFS *BACKUP command will give the "disc fault" error. Copy-protection will be covered in detail in module 6. Two bad track registers are available for each disc surface and they are used to specify which tracks are to be totally ignored by the 8271. For example, if track 1 is bad the 8271 will use track 3 when track 2 is specified. As far as the disc controller is concerned physical track 3 is seen as physical track 2, physical track 4 is seen as physical track 3, and so on. When bad tracks are used their track number IDs should be set to &FF when the disc is formatted. Track 0 must not be set as a bad track. The command lasts until a hard reset. The following parameter block is used by Osword &7F Load Bad Tracks. Parameter block &00 = drive number (&00-&03 or &FF) Parameter block &01 - &04 = buffer address (not used) Parameter block &05 = &04 (4 command parameters) Parameter block &06 = &75 (load bad tracks command) Parameter block &07 = drive pair (&10 = drive 0/2, &18 = drive 1/3) Parameter block &08 = bad track number 1 Parameter block &09 = bad track number 2 Parameter block &0A = current physical track Parameter block &0B = result byte The following code could be used to load bad tracks 1 and 2. Osword &7F Seek command is used to position the head over a known physical track, in this case track zero. JSR seekzero \ seek track zero LDA #&7F LDX #block MOD 256 LDY #block DIV 256 JSR &FFF1 RTS .block EQUB &00 \ drive 0 EQUD &00 \ buffer address (not used) EQUB &04 \ 4 parameters EQUB &75 \ load bad tracks command EQUB &10 \ drive 0/2 EQUB &01 \ track 1 EQUB &02 \ track 2 EQUB &00 \ current track EQUB &00 \ result byte --------------------------------- Osword &7F Write Special Register --------------------------------- The internal registers of the 8271 can be overwritten using the Osword &7F Write Special Register command. The contents of all the registers in figure 4 can be altered but you are advised to limit yourself to altering the track registers, numbers &12 and &1A. The bad track registers have their own Osword &7F Load Bad Tracks command described above but they can also be altered with the Osword &7F Write Special Register command. If you decide to alter any other registers the results are likely to be disasterous - you have been warned! +--------------+---------------------------------+ | Register no. | Register | +--------------+---------------------------------+ | &06 | Scan sector register | | &10 | Bad track register 1, drive 0/2 | | &11 | Bad track register 2, drive 0/2 | | &12 | Track register, drive 0/2 | | &13 | Scan count register (LSB) | | &14 | Scan count register (MSB) | | &17 | DMA mode register | | &18 | Bad track register 1, drive 1/3 | | &19 | Bad track register 2, drive 1/3 | | &1A | Track register, drive 1/3 | | &22 | Drive control input register | | &23 | Drive control output register | +--------------+---------------------------------+ Figure 4. The 8271 registers ---------------------------- The following parameter block must be used with the Osword &7F Write Special Register command. Parameter block &00 = drive number (&00-&03 or &FF) Parameter block &01 - &04 = buffer address (not used) Parameter block &05 = &02 (2 command parameters) Parameter block &06 = &7A (write special register command) Parameter block &07 = register number (from figure 4) Parameter block &08 = value to put in register Parameter block &09 = result byte The track registers &12 (drive 0/2) and &1A (drive 1/3) are used by the disc controller to identify its current track position. These registers contain the number of the physical track. If the logical track number stored in the sector ID is not the same as the physical track number you should always use the write special register command to store the logical track number in the track register before attempting to read from or write to the disc. You must always reset the track register to its original value after reading or writing. As you have seen in the module 0, using different logical and physical track numbers is yet another technique for copy-protecting discs. The following code could be used to seek track 0 and then load the track register for drive 0/2 with the number 1. Track zero will then be seen as physical track 1. JSR seekzero \ seek track zero LDA #&7F LDX #block MOD 256 LDY #block DIV 256 JSR &FFF1 RTS .block EQUB &00 \ drive 0 EQUD &00 \ buffer address (not used) EQUB &02 \ 2 parameters EQUB &7A \ write special register command EQUB &12 \ track register drive 0/2 EQUB &01 \ track 1 EQUB &00 \ result byte -------------------------------- Osword &7F Read Special Register -------------------------------- The internal registers of the 8271 can be read using Osword &7F Read Special Register. The contents of all the registers in figure 4 can be read but not all the registers give useful results. The drive control input register can be read using Osword &7F Read Drive Status command but the drive control output register, and all the other registers, have to be read with the Osword &7F Read Special Register command. The following parameter block must be used with the Osword &7F Read Special Register command. Parameter block &00 = drive number (&00-&03 or &FF) Parameter block &01 - &04 = buffer address (not used) Parameter block &05 = &01 (1 command parameter) Parameter block &06 = &7D (read special register command) Parameter block &07 = register number (from figure 4) Parameter block &08 = result byte The program OUTPUT demonstrates how to read the contents of the drive control output register for the current drive. The result is printed in hexadecimal and binary. Each bit of the result has the following meaning: bit 7 = SELECT 1 bit 6 = SELECT 0 bit 5 = FAULT RESET?OP0 bit 4 = LOW CURRENT bit 3 = LOAD HEAD bit 2 = DIRECTION bit 1 = SEEK/STEP bit 0 = WR ENABLE It is interesting to run the program OUTPUT with drive 0 selected (using *DRIVE 0) and then select drive 1 (with *DRIVE 1) and run the program again to see the difference it makes to the result. If you want to read any other register change the value &23 in line 180 for another register number taken from figure 4. 10 REM: OUTPUT 20 oswrch=&FFEE 30 osword=&FFF1 40 DIM mcode &100 50 FOR pass = 0 TO 2 STEP 2 60 P%=mcode 70 [ OPT pass 80 LDA #&7F 90 LDX #block MOD 256 100 LDY #block DIV 256 110 JSR osword 120 RTS 130 .block 140 EQUB &FF \ current drive 150 EQUD &00 \ does not matter 160 EQUB &01 \ 1 parameter 170 EQUB &7D \ read special register command 180 EQUB &23 \ drive control output register 190 .result 200 EQUB &00 \ result byte 210 .binary 220 LDX #8 230 .loop 240 LDA #ASC("0") 250 ASL result 260 ADC #&00 270 JSR oswrch 280 DEX 290 BNE loop 300 RTS 310 ] 320 NEXT 330 CALL mcode 340 PRINT"Result = &";~?result;", %"; 350 CALL binary 360 PRINT
00000000 54 68 65 20 41 63 6f 72 6e 20 44 46 53 20 4f 73 |The Acorn DFS Os| 00000010 77 6f 72 64 20 63 6f 6d 6d 61 6e 64 73 20 20 2d |word commands -| 00000020 20 20 62 79 20 20 2d 20 20 47 6f 72 64 6f 6e 20 | by - Gordon | 00000030 48 6f 72 73 69 6e 67 74 6f 6e 0d 2d 2d 2d 2d 2d |Horsington.-----| 00000040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000070 2d 2d 2d 2d 2d 0d 0d 4d 6f 64 75 6c 65 20 31 2e |-----..Module 1.| 00000080 20 54 68 65 20 44 46 53 20 4f 73 77 6f 72 64 20 | The DFS Osword | 00000090 63 6f 6d 6d 61 6e 64 73 20 28 70 61 72 74 20 31 |commands (part 1| 000000a0 29 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |).--------------| 000000b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000000c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d 20 20 |------------.. | 000000d0 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +-----------| 000000e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000100 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 00000110 0d 20 20 20 20 20 20 7c 20 41 6c 6c 20 74 68 65 |. | All the| 00000120 20 44 46 53 20 6d 6f 64 75 6c 65 73 20 69 6e 20 | DFS modules in | 00000130 20 74 68 69 73 20 20 73 65 72 69 65 73 20 20 75 | this series u| 00000140 73 65 20 70 72 6f 67 72 61 6d 73 20 77 68 69 63 |se programs whic| 00000150 68 20 7c 0d 20 20 20 20 20 20 7c 20 65 78 70 65 |h |. | expe| 00000160 72 69 6d 65 6e 74 20 20 77 69 74 68 20 74 68 65 |riment with the| 00000170 20 66 6f 72 6d 61 74 20 61 6e 64 20 63 6f 6e 74 | format and cont| 00000180 65 6e 74 73 20 6f 66 20 64 69 73 63 73 2e 20 54 |ents of discs. T| 00000190 68 65 73 65 20 7c 0d 20 20 20 20 20 20 7c 20 65 |hese |. | e| 000001a0 78 70 65 72 69 6d 65 6e 74 73 20 6d 61 79 20 20 |xperiments may | 000001b0 68 61 76 65 20 64 69 73 61 73 74 65 72 6f 75 73 |have disasterous| 000001c0 20 65 66 66 65 63 74 73 20 69 66 20 79 6f 75 20 | effects if you | 000001d0 75 73 65 20 61 6e 79 20 7c 0d 20 20 20 20 20 20 |use any |. | 000001e0 7c 20 6f 66 20 74 68 65 20 70 72 6f 67 72 61 6d || of the program| 000001f0 73 20 20 6f 6e 20 20 64 69 73 63 73 20 20 77 68 |s on discs wh| 00000200 69 63 68 20 73 74 6f 72 65 20 70 72 6f 67 72 61 |ich store progra| 00000210 6d 73 20 6f 72 20 64 61 74 61 20 7c 0d 20 20 20 |ms or data |. | 00000220 20 20 20 7c 20 77 68 69 63 68 20 79 6f 75 20 63 | | which you c| 00000230 61 6e 6e 6f 74 20 61 66 66 6f 72 64 20 74 6f 20 |annot afford to | 00000240 6c 6f 73 65 2e 20 20 59 6f 75 20 20 73 68 6f 75 |lose. You shou| 00000250 6c 64 20 20 66 69 72 73 74 20 74 72 79 20 7c 0d |ld first try |.| 00000260 20 20 20 20 20 20 7c 20 6f 75 74 20 20 74 68 65 | | out the| 00000270 20 20 70 72 6f 67 72 61 6d 73 20 20 75 73 69 6e | programs usin| 00000280 67 20 20 64 69 73 63 73 20 20 74 68 61 74 20 20 |g discs that | 00000290 68 61 76 65 20 65 69 74 68 65 72 20 62 65 65 6e |have either been| 000002a0 20 7c 0d 20 20 20 20 20 20 7c 20 64 75 70 6c 69 | |. | dupli| 000002b0 63 61 74 65 64 20 6f 72 2c 20 62 65 74 74 65 72 |cated or, better| 000002c0 20 73 74 69 6c 6c 2c 20 68 61 76 65 20 6e 6f 74 | still, have not| 000002d0 20 62 65 65 6e 20 75 73 65 64 20 61 74 20 61 6c | been used at al| 000002e0 6c 2e 20 20 7c 0d 20 20 20 20 20 20 2b 2d 2d 2d |l. |. +---| 000002f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000320 2d 2d 2d 2d 2d 2d 2d 2b 0d 0d 0d 54 68 65 20 44 |-------+...The D| 00000330 46 53 20 52 4f 4d 20 69 6e 74 65 72 63 65 70 74 |FS ROM intercept| 00000340 73 20 61 6e 64 20 72 65 63 6f 67 6e 69 73 65 73 |s and recognises| 00000350 20 74 68 72 65 65 20 4f 73 77 6f 72 64 20 63 61 | three Osword ca| 00000360 6c 6c 73 2e 20 4f 73 77 6f 72 64 20 26 37 44 20 |lls. Osword &7D | 00000370 72 65 61 64 73 0d 74 68 65 20 6e 75 6d 62 65 72 |reads.the number| 00000380 20 6f 66 20 74 69 6d 65 73 20 61 20 64 69 73 6b | of times a disk| 00000390 20 68 61 73 20 62 65 65 6e 20 77 72 69 74 74 65 | has been writte| 000003a0 6e 2c 20 4f 73 77 6f 72 64 20 26 37 45 20 72 65 |n, Osword &7E re| 000003b0 61 64 73 20 74 68 65 20 6e 75 6d 62 65 72 0d 6f |ads the number.o| 000003c0 66 20 73 65 63 74 6f 72 73 20 6f 6e 20 61 20 64 |f sectors on a d| 000003d0 69 73 63 2c 20 61 6e 64 20 4f 73 77 6f 72 64 20 |isc, and Osword | 000003e0 26 37 46 20 65 78 65 63 75 74 65 73 20 74 68 65 |&7F executes the| 000003f0 20 38 32 37 31 20 64 69 73 63 20 63 6f 6e 74 72 | 8271 disc contr| 00000400 6f 6c 6c 65 72 0d 63 6f 6d 6d 61 6e 64 73 2e 0d |oller.commands..| 00000410 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 4f 73 77 6f |.----------.Oswo| 00000420 72 64 20 26 37 44 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d |rd &7D.---------| 00000430 2d 0d 0d 4f 73 77 6f 72 64 20 26 37 44 20 72 65 |-..Osword &7D re| 00000440 61 64 73 20 74 68 65 20 63 61 74 61 6c 6f 67 75 |ads the catalogu| 00000450 65 20 66 6f 72 20 74 68 65 20 63 75 72 72 65 6e |e for the curren| 00000460 74 20 64 65 66 61 75 6c 74 20 64 69 73 63 2c 20 |t default disc, | 00000470 61 73 20 73 70 65 63 69 66 69 65 64 0d 62 79 20 |as specified.by | 00000480 74 68 65 20 6d 6f 73 74 20 72 65 63 65 6e 74 20 |the most recent | 00000490 2a 44 52 49 56 45 20 63 6f 6d 6d 61 6e 64 2c 20 |*DRIVE command, | 000004a0 61 6e 64 20 65 78 74 72 61 63 74 73 20 74 68 65 |and extracts the| 000004b0 20 6e 75 6d 62 65 72 20 6f 66 20 64 69 73 63 20 | number of disc | 000004c0 63 79 63 6c 65 73 0d 66 72 6f 6d 20 74 68 65 20 |cycles.from the | 000004d0 63 61 74 61 6c 6f 67 75 65 2e 20 54 68 65 20 6e |catalogue. The n| 000004e0 75 6d 62 65 72 20 6f 66 20 64 69 73 63 20 63 79 |umber of disc cy| 000004f0 63 6c 65 73 20 69 73 20 61 20 42 43 44 20 6e 75 |cles is a BCD nu| 00000500 6d 62 65 72 20 69 6e 20 74 68 65 20 72 61 6e 67 |mber in the rang| 00000510 65 0d 66 72 6f 6d 20 30 20 74 6f 20 39 39 2e 20 |e.from 0 to 99. | 00000520 54 68 69 73 20 6e 75 6d 62 65 72 20 67 69 76 65 |This number give| 00000530 73 20 73 6f 6d 65 20 69 6e 64 69 63 61 74 69 6f |s some indicatio| 00000540 6e 20 6f 66 20 68 6f 77 20 6d 61 6e 79 20 74 69 |n of how many ti| 00000550 6d 65 73 20 74 68 65 20 64 69 73 63 0d 68 61 73 |mes the disc.has| 00000560 20 62 65 65 6e 20 77 72 69 74 74 65 6e 2e 20 42 | been written. B| 00000570 65 63 61 75 73 65 20 54 68 65 20 64 69 73 63 20 |ecause The disc | 00000580 63 79 63 6c 65 20 6e 75 6d 62 65 72 20 72 65 73 |cycle number res| 00000590 74 61 72 74 73 20 61 74 20 30 20 61 66 74 65 72 |tarts at 0 after| 000005a0 0d 72 65 61 63 68 69 6e 67 20 39 39 20 74 68 69 |.reaching 99 thi| 000005b0 73 20 69 73 20 6e 6f 74 20 61 20 72 65 6c 69 61 |s is not a relia| 000005c0 62 6c 65 20 63 6f 75 6e 74 2e 0d 0d 54 68 65 20 |ble count...The | 000005d0 63 61 74 61 6c 6f 67 75 65 20 69 73 20 72 65 61 |catalogue is rea| 000005e0 64 20 62 79 20 4f 73 77 6f 72 64 20 26 37 44 20 |d by Osword &7D | 000005f0 61 6e 64 20 73 74 6f 72 65 64 20 69 6e 20 74 68 |and stored in th| 00000600 65 20 66 69 72 73 74 20 74 77 6f 20 70 61 67 65 |e first two page| 00000610 73 20 6f 66 0d 74 68 65 20 70 61 67 65 64 20 52 |s of.the paged R| 00000620 4f 4d 20 61 62 73 6f 6c 75 74 65 20 77 6f 72 6b |OM absolute work| 00000630 73 70 61 63 65 20 28 70 61 67 65 73 20 26 30 45 |space (pages &0E| 00000640 20 61 6e 64 20 26 30 46 20 77 69 74 68 20 4f 53 | and &0F with OS| 00000650 20 31 2e 32 29 2e 20 54 68 65 0d 72 65 73 75 6c | 1.2). The.resul| 00000660 74 20 69 73 20 73 74 6f 72 65 64 20 69 6e 20 61 |t is stored in a| 00000670 20 6f 6e 65 20 62 79 74 65 20 70 61 72 61 6d 65 | one byte parame| 00000680 74 65 72 20 62 6c 6f 63 6b 20 73 70 65 63 69 66 |ter block specif| 00000690 69 65 64 20 62 79 20 58 20 61 6e 64 20 59 0d 72 |ied by X and Y.r| 000006a0 65 67 69 73 74 65 72 73 20 6f 6e 20 65 6e 74 72 |egisters on entr| 000006b0 79 2e 20 54 68 65 20 70 72 6f 67 72 61 6d 20 43 |y. The program C| 000006c0 59 43 4c 45 53 20 64 65 6d 6f 6e 73 74 72 61 74 |YCLES demonstrat| 000006d0 65 73 20 68 6f 77 20 4f 73 77 6f 72 64 20 26 37 |es how Osword &7| 000006e0 44 20 63 61 6e 20 62 65 0d 75 73 65 64 20 74 6f |D can be.used to| 000006f0 20 72 65 61 64 20 74 68 65 20 64 69 73 63 20 63 | read the disc c| 00000700 79 63 6c 65 73 2e 0d 0d 0d 20 20 20 31 30 20 52 |ycles.... 10 R| 00000710 45 4d 3a 20 43 59 43 4c 45 53 0d 20 20 20 32 30 |EM: CYCLES. 20| 00000720 20 6f 73 77 6f 72 64 3d 26 46 46 46 31 0d 20 20 | osword=&FFF1. | 00000730 20 33 30 20 44 49 4d 20 6d 63 6f 64 65 20 26 31 | 30 DIM mcode &1| 00000740 30 30 0d 20 20 20 34 30 20 46 4f 52 20 70 61 73 |00. 40 FOR pas| 00000750 73 20 3d 20 30 20 54 4f 20 32 20 53 54 45 50 20 |s = 0 TO 2 STEP | 00000760 32 0d 20 20 20 35 30 20 50 25 3d 6d 63 6f 64 65 |2. 50 P%=mcode| 00000770 0d 20 20 20 36 30 20 5b 20 20 20 20 20 20 20 4f |. 60 [ O| 00000780 50 54 20 70 61 73 73 0d 20 20 20 37 30 20 20 20 |PT pass. 70 | 00000790 20 20 20 20 20 20 4c 44 41 20 23 26 37 44 0d 20 | LDA #&7D. | 000007a0 20 20 38 30 20 20 20 20 20 20 20 20 20 4c 44 58 | 80 LDX| 000007b0 20 23 72 65 73 75 6c 74 20 4d 4f 44 20 32 35 36 | #result MOD 256| 000007c0 0d 20 20 20 39 30 20 20 20 20 20 20 20 20 20 4c |. 90 L| 000007d0 44 59 20 23 72 65 73 75 6c 74 20 44 49 56 20 32 |DY #result DIV 2| 000007e0 35 36 0d 20 20 31 30 30 20 20 20 20 20 20 20 20 |56. 100 | 000007f0 20 4a 53 52 20 6f 73 77 6f 72 64 0d 20 20 31 31 | JSR osword. 11| 00000800 30 20 20 20 20 20 20 20 20 20 52 54 53 0d 20 20 |0 RTS. | 00000810 31 32 30 20 2e 72 65 73 75 6c 74 0d 20 20 31 33 |120 .result. 13| 00000820 30 20 20 20 20 20 20 20 20 20 45 51 55 42 20 26 |0 EQUB &| 00000830 30 30 0d 20 20 31 34 30 20 5d 0d 20 20 31 35 30 |00. 140 ]. 150| 00000840 20 4e 45 58 54 0d 20 20 31 36 30 20 43 41 4c 4c | NEXT. 160 CALL| 00000850 20 6d 63 6f 64 65 0d 20 20 31 37 30 20 50 52 49 | mcode. 170 PRI| 00000860 4e 54 22 44 69 73 63 20 63 79 63 6c 65 73 20 3d |NT"Disc cycles =| 00000870 20 22 3b 7e 3f 72 65 73 75 6c 74 0d 0d 0d 2d 2d | ";~?result...--| 00000880 2d 2d 2d 2d 2d 2d 2d 2d 0d 4f 73 77 6f 72 64 20 |--------.Osword | 00000890 26 37 45 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d |&7E.----------..| 000008a0 4f 73 77 6f 72 64 20 26 37 45 20 72 65 61 64 73 |Osword &7E reads| 000008b0 20 74 68 65 20 63 61 74 61 6c 6f 67 75 65 20 66 | the catalogue f| 000008c0 6f 72 20 74 68 65 20 63 75 72 72 65 6e 74 20 64 |or the current d| 000008d0 65 66 61 75 6c 74 20 64 69 73 63 2c 20 61 73 20 |efault disc, as | 000008e0 73 70 65 63 69 66 69 65 64 0d 62 79 20 74 68 65 |specified.by the| 000008f0 20 6d 6f 73 74 20 72 65 63 65 6e 74 20 2a 44 52 | most recent *DR| 00000900 49 56 45 20 63 6f 6d 6d 61 6e 64 2c 20 61 6e 64 |IVE command, and| 00000910 20 65 78 74 72 61 63 74 73 20 74 68 65 20 6e 75 | extracts the nu| 00000920 6d 62 65 72 20 6f 66 20 73 65 63 74 6f 72 73 0d |mber of sectors.| 00000930 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 65 |available on the| 00000940 20 64 69 73 63 2e 20 54 68 65 72 65 20 61 72 65 | disc. There are| 00000950 20 38 30 30 20 28 26 33 32 30 29 20 73 65 63 74 | 800 (&320) sect| 00000960 6f 72 73 20 6f 6e 20 61 6e 20 38 30 20 74 72 61 |ors on an 80 tra| 00000970 63 6b 20 41 63 6f 72 6e 0d 44 46 53 20 64 69 73 |ck Acorn.DFS dis| 00000980 63 20 61 6e 64 20 34 30 30 20 28 26 31 39 30 29 |c and 400 (&190)| 00000990 20 73 65 63 74 6f 72 73 20 6f 6e 20 61 20 34 30 | sectors on a 40| 000009a0 20 74 72 61 63 6b 20 41 63 6f 72 6e 20 44 46 53 | track Acorn DFS| 000009b0 20 64 69 73 63 2e 20 4e 6f 6e 2d 73 74 61 6e 64 | disc. Non-stand| 000009c0 61 72 64 0d 61 6e 64 20 63 6f 70 79 2d 70 72 6f |ard.and copy-pro| 000009d0 74 65 63 74 65 64 20 64 69 73 63 73 20 6d 61 79 |tected discs may| 000009e0 20 68 61 76 65 20 64 69 66 66 65 72 65 6e 74 20 | have different | 000009f0 6e 75 6d 62 65 72 73 20 6f 66 20 61 76 61 69 6c |numbers of avail| 00000a00 61 62 6c 65 20 73 65 63 74 6f 72 73 2e 0d 0d 54 |able sectors...T| 00000a10 68 65 20 63 61 74 61 6c 6f 67 75 65 20 69 73 20 |he catalogue is | 00000a20 72 65 61 64 20 62 79 20 4f 73 77 6f 72 64 20 26 |read by Osword &| 00000a30 37 45 20 61 6e 64 20 73 74 6f 72 65 64 20 69 6e |7E and stored in| 00000a40 20 74 68 65 20 66 69 72 73 74 20 74 77 6f 20 70 | the first two p| 00000a50 61 67 65 73 20 6f 66 0d 74 68 65 20 70 61 67 65 |ages of.the page| 00000a60 64 20 52 4f 4d 20 61 62 73 6f 6c 75 74 65 20 77 |d ROM absolute w| 00000a70 6f 72 6b 73 70 61 63 65 20 28 70 61 67 65 73 20 |orkspace (pages | 00000a80 26 30 45 20 61 6e 64 20 26 30 46 20 77 69 74 68 |&0E and &0F with| 00000a90 20 4f 53 20 31 2e 32 29 2e 20 54 68 65 0d 72 65 | OS 1.2). The.re| 00000aa0 73 75 6c 74 20 69 73 20 73 74 6f 72 65 64 20 69 |sult is stored i| 00000ab0 6e 20 61 20 66 6f 75 72 20 62 79 74 65 20 70 61 |n a four byte pa| 00000ac0 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 73 70 |rameter block sp| 00000ad0 65 63 69 66 69 65 64 20 62 79 20 74 68 65 20 58 |ecified by the X| 00000ae0 20 61 6e 64 20 59 0d 72 65 67 69 73 74 65 72 73 | and Y.registers| 00000af0 20 6f 6e 20 65 6e 74 72 79 2e 20 54 68 65 20 70 | on entry. The p| 00000b00 72 6f 67 72 61 6d 20 48 4f 57 4d 41 4e 59 20 64 |rogram HOWMANY d| 00000b10 65 6d 6f 6e 73 74 72 61 74 65 73 20 68 6f 77 20 |emonstrates how | 00000b20 4f 73 77 6f 72 64 20 26 37 45 20 63 61 6e 20 62 |Osword &7E can b| 00000b30 65 0d 75 73 65 64 20 74 6f 20 72 65 61 64 20 74 |e.used to read t| 00000b40 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 61 76 61 |he number of ava| 00000b50 69 6c 61 62 6c 65 20 73 65 63 74 6f 72 73 20 6f |ilable sectors o| 00000b60 6e 20 61 20 44 46 53 20 64 69 73 63 2e 20 54 68 |n a DFS disc. Th| 00000b70 65 20 6c 65 61 73 74 0d 73 69 67 6e 69 66 69 63 |e least.signific| 00000b80 61 6e 74 20 62 79 74 65 20 6f 66 20 74 68 65 20 |ant byte of the | 00000b90 6e 75 6d 62 65 72 20 6f 66 20 73 65 63 74 6f 72 |number of sector| 00000ba0 73 20 77 69 6c 6c 20 62 65 20 69 6e 20 62 79 74 |s will be in byt| 00000bb0 65 20 26 30 31 20 6f 66 20 74 68 65 0d 72 65 73 |e &01 of the.res| 00000bc0 75 6c 74 20 61 6e 64 20 74 68 65 20 6d 6f 73 74 |ult and the most| 00000bd0 20 73 69 67 6e 69 66 69 63 61 6e 74 20 62 79 74 | significant byt| 00000be0 65 20 69 6e 20 62 79 74 65 20 26 30 32 20 6f 66 |e in byte &02 of| 00000bf0 20 74 68 65 20 72 65 73 75 6c 74 2e 20 42 79 74 | the result. Byt| 00000c00 65 73 20 26 30 30 0d 61 6e 64 20 26 30 33 20 6f |es &00.and &03 o| 00000c10 66 20 74 68 65 20 72 65 73 75 6c 74 20 73 68 6f |f the result sho| 00000c20 75 6c 64 20 61 6c 77 61 79 73 20 62 65 20 7a 65 |uld always be ze| 00000c30 72 6f 2e 0d 0d 0d 20 20 20 31 30 20 52 45 4d 3a |ro.... 10 REM:| 00000c40 20 48 4f 57 4d 41 4e 59 0d 20 20 20 32 30 20 6f | HOWMANY. 20 o| 00000c50 73 77 6f 72 64 3d 26 46 46 46 31 0d 20 20 20 33 |sword=&FFF1. 3| 00000c60 30 20 44 49 4d 20 6d 63 6f 64 65 20 26 31 30 30 |0 DIM mcode &100| 00000c70 0d 20 20 20 34 30 20 46 4f 52 20 70 61 73 73 20 |. 40 FOR pass | 00000c80 3d 20 30 20 54 4f 20 32 20 53 54 45 50 20 32 0d |= 0 TO 2 STEP 2.| 00000c90 20 20 20 35 30 20 50 25 3d 6d 63 6f 64 65 0d 20 | 50 P%=mcode. | 00000ca0 20 20 36 30 20 5b 20 20 20 20 20 20 20 4f 50 54 | 60 [ OPT| 00000cb0 20 70 61 73 73 0d 20 20 20 37 30 20 20 20 20 20 | pass. 70 | 00000cc0 20 20 20 20 4c 44 41 20 23 26 37 45 0d 20 20 20 | LDA #&7E. | 00000cd0 38 30 20 20 20 20 20 20 20 20 20 4c 44 58 20 23 |80 LDX #| 00000ce0 72 65 73 75 6c 74 20 4d 4f 44 20 32 35 36 0d 20 |result MOD 256. | 00000cf0 20 20 39 30 20 20 20 20 20 20 20 20 20 4c 44 59 | 90 LDY| 00000d00 20 23 72 65 73 75 6c 74 20 44 49 56 20 32 35 36 | #result DIV 256| 00000d10 0d 20 20 31 30 30 20 20 20 20 20 20 20 20 20 4a |. 100 J| 00000d20 53 52 20 6f 73 77 6f 72 64 0d 20 20 31 31 30 20 |SR osword. 110 | 00000d30 20 20 20 20 20 20 20 20 52 54 53 0d 20 20 31 32 | RTS. 12| 00000d40 30 20 2e 72 65 73 75 6c 74 0d 20 20 31 33 30 20 |0 .result. 130 | 00000d50 20 20 20 20 20 20 20 20 45 51 55 44 20 26 30 30 | EQUD &00| 00000d60 0d 20 20 31 34 30 20 5d 0d 20 20 31 35 30 20 4e |. 140 ]. 150 N| 00000d70 45 58 54 0d 20 20 31 36 30 20 43 41 4c 4c 20 6d |EXT. 160 CALL m| 00000d80 63 6f 64 65 0d 20 20 31 37 30 20 50 52 49 4e 54 |code. 170 PRINT| 00000d90 22 26 22 3b 7e 72 65 73 75 6c 74 3f 32 3b 7e 72 |"&";~result?2;~r| 00000da0 65 73 75 6c 74 3f 31 3b 22 20 53 65 63 74 6f 72 |esult?1;" Sector| 00000db0 73 22 0d 0d 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d |s"...----------.| 00000dc0 4f 73 77 6f 72 64 20 26 37 46 0d 2d 2d 2d 2d 2d |Osword &7F.-----| 00000dd0 2d 2d 2d 2d 2d 0d 0d 4f 73 77 6f 72 64 20 26 37 |-----..Osword &7| 00000de0 46 20 65 78 65 63 75 74 65 73 20 74 68 65 20 38 |F executes the 8| 00000df0 32 37 31 20 64 69 73 63 20 63 6f 6e 74 72 6f 6c |271 disc control| 00000e00 6c 65 72 20 63 6f 6d 6d 61 6e 64 73 2e 20 49 66 |ler commands. If| 00000e10 20 74 68 65 20 64 69 73 63 0d 69 6e 74 65 72 66 | the disc.interf| 00000e20 61 63 65 20 75 73 65 73 20 61 20 31 37 37 30 20 |ace uses a 1770 | 00000e30 64 69 73 63 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 |disc controller | 00000e40 74 68 65 6e 20 4f 73 77 6f 72 64 20 26 37 46 20 |then Osword &7F | 00000e50 65 6d 75 6c 61 74 65 73 20 74 68 65 20 38 32 37 |emulates the 827| 00000e60 31 0d 63 6f 6d 6d 61 6e 64 20 73 65 74 20 75 73 |1.command set us| 00000e70 69 6e 67 20 74 68 65 20 31 37 37 30 2e 20 54 68 |ing the 1770. Th| 00000e80 65 20 63 6f 6d 70 6c 65 74 65 20 63 6f 6d 6d 61 |e complete comma| 00000e90 6e 64 20 73 65 74 20 65 78 65 63 75 74 65 64 20 |nd set executed | 00000ea0 62 79 20 4f 73 77 6f 72 64 0d 26 37 46 20 69 73 |by Osword.&7F is| 00000eb0 20 73 68 6f 77 6e 20 69 6e 20 66 69 67 75 72 65 | shown in figure| 00000ec0 20 31 2e 20 4e 6f 74 20 61 6c 6c 20 74 68 65 20 | 1. Not all the | 00000ed0 38 32 37 31 20 63 6f 6d 6d 61 6e 64 73 20 63 61 |8271 commands ca| 00000ee0 6e 20 62 65 20 65 6d 75 6c 61 74 65 64 20 62 79 |n be emulated by| 00000ef0 20 74 68 65 0d 31 37 37 30 20 61 6e 64 20 74 68 | the.1770 and th| 00000f00 65 20 4f 73 77 6f 72 64 20 26 37 46 20 63 6f 6d |e Osword &7F com| 00000f10 6d 61 6e 64 73 20 66 72 6f 6d 20 26 36 43 20 74 |mands from &6C t| 00000f20 6f 20 26 37 44 20 61 72 65 20 6e 6f 74 20 66 75 |o &7D are not fu| 00000f30 6c 6c 79 20 69 6d 70 6c 65 6d 65 6e 74 65 64 0d |lly implemented.| 00000f40 77 69 74 68 20 74 68 65 20 41 63 6f 72 6e 20 31 |with the Acorn 1| 00000f50 37 37 30 20 64 69 73 63 20 69 6e 74 65 72 66 61 |770 disc interfa| 00000f60 63 65 2e 0d 0d 57 68 65 6e 20 79 6f 75 20 77 72 |ce...When you wr| 00000f70 69 74 65 20 73 6f 66 74 77 61 72 65 20 77 68 69 |ite software whi| 00000f80 63 68 20 75 73 65 73 20 74 68 65 20 4f 73 77 6f |ch uses the Oswo| 00000f90 72 64 20 26 37 46 20 63 6f 6d 6d 61 6e 64 73 20 |rd &7F commands | 00000fa0 66 72 6f 6d 20 26 36 43 20 74 6f 20 26 37 44 0d |from &6C to &7D.| 00000fb0 79 6f 75 20 73 68 6f 75 6c 64 20 74 61 6b 65 20 |you should take | 00000fc0 63 61 72 65 20 74 6f 20 65 6e 73 75 72 65 20 74 |care to ensure t| 00000fd0 68 61 74 20 79 6f 75 72 20 70 72 6f 67 72 61 6d |hat your program| 00000fe0 73 20 77 69 6c 6c 20 77 6f 72 6b 20 77 69 74 68 |s will work with| 00000ff0 20 74 68 65 20 31 37 37 30 0d 64 69 73 63 20 63 | the 1770.disc c| 00001000 6f 6e 74 72 6f 6c 6c 65 72 20 61 73 20 77 65 6c |ontroller as wel| 00001010 6c 20 61 73 20 77 69 74 68 20 74 68 65 20 38 32 |l as with the 82| 00001020 37 31 20 69 6e 74 65 72 66 61 63 65 2e 20 53 6f |71 interface. So| 00001030 6d 65 20 6f 66 20 74 68 65 20 65 78 61 6d 70 6c |me of the exampl| 00001040 65 0d 70 72 6f 67 72 61 6d 73 20 75 73 65 64 20 |e.programs used | 00001050 69 6e 20 74 68 69 73 20 6d 6f 64 75 6c 65 20 75 |in this module u| 00001060 73 65 20 74 68 65 73 65 20 70 61 72 74 6c 79 20 |se these partly | 00001070 69 6d 70 6c 65 6d 65 6e 74 65 64 20 4f 73 77 6f |implemented Oswo| 00001080 72 64 20 26 37 46 0d 63 6f 6d 6d 61 6e 64 73 20 |rd &7F.commands | 00001090 61 6e 64 20 6d 61 79 20 6e 6f 74 20 77 6f 72 6b |and may not work| 000010a0 20 61 73 20 65 78 70 65 63 74 65 64 20 77 69 74 | as expected wit| 000010b0 68 20 61 6c 6c 20 31 37 37 30 20 64 69 73 63 20 |h all 1770 disc | 000010c0 69 6e 74 65 72 66 61 63 65 73 2e 20 54 68 65 0d |interfaces. The.| 000010d0 70 72 6f 67 72 61 6d 73 20 75 73 65 64 20 74 6f |programs used to| 000010e0 20 69 6c 6c 75 73 74 72 61 74 65 20 74 68 65 20 | illustrate the | 000010f0 6f 74 68 65 72 20 4f 73 77 6f 72 64 20 26 37 46 |other Osword &7F| 00001100 20 63 6f 6d 6d 61 6e 64 73 20 61 6c 6c 20 77 6f | commands all wo| 00001110 72 6b 20 77 69 74 68 0d 74 68 65 20 41 63 6f 72 |rk with.the Acor| 00001120 6e 20 31 37 37 30 20 44 46 53 2e 0d 0d 0d 2b 2d |n 1770 DFS....+-| 00001130 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d |--------+-------| 00001140 2d 2b 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d |-+------+-------| 00001150 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001170 2d 2d 2d 2d 2b 0d 7c 20 43 6f 6d 6d 61 6e 64 20 |----+.| Command | 00001180 7c 20 50 61 72 61 6d 2d 20 7c 20 31 37 37 30 20 || Param- | 1770 | 00001190 7c 20 20 41 63 74 69 6f 6e 20 20 20 20 20 20 20 || Action | 000011a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000011b0 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 | |.| | 000011c0 6e 75 6d 62 65 72 20 20 7c 20 65 74 65 72 73 20 |number | eters | 000011d0 20 7c 20 20 20 20 20 20 7c 20 20 20 20 20 20 20 | | | | 000011e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001200 20 20 20 20 7c 0d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d | |.+---------| 00001210 2b 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d |+--------+------| 00001220 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |+---------------| 00001230 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001240 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 7c 20 |------------+.| | 00001250 20 20 26 34 41 20 20 20 7c 20 20 20 20 32 20 20 | &4A | 2 | 00001260 20 7c 20 20 59 65 73 20 7c 20 57 72 69 74 65 20 | | Yes | Write | 00001270 64 61 74 61 20 31 32 38 20 62 79 74 65 73 20 20 |data 128 bytes | 00001280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001290 20 20 20 20 7c 0d 7c 20 20 20 26 34 42 20 20 20 | |.| &4B | 000012a0 7c 20 20 20 20 33 20 20 20 7c 20 20 59 65 73 20 || 3 | Yes | 000012b0 7c 20 57 72 69 74 65 20 64 61 74 61 20 6d 75 6c || Write data mul| 000012c0 74 69 2d 73 65 63 74 6f 72 20 20 20 20 20 20 20 |ti-sector | 000012d0 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 | |.| | 000012e0 20 20 26 34 45 20 20 20 7c 20 20 20 20 32 20 20 | &4E | 2 | 000012f0 20 7c 20 20 59 65 73 20 7c 20 57 72 69 74 65 20 | | Yes | Write | 00001300 64 65 6c 65 74 65 64 20 64 61 74 61 20 31 32 38 |deleted data 128| 00001310 20 62 79 74 65 73 20 20 20 20 20 20 20 20 20 20 | bytes | 00001320 20 20 20 20 7c 0d 7c 20 20 20 26 34 46 20 20 20 | |.| &4F | 00001330 7c 20 20 20 20 33 20 20 20 7c 20 20 59 65 73 20 || 3 | Yes | 00001340 7c 20 57 72 69 74 65 20 64 65 6c 65 74 65 64 20 || Write deleted | 00001350 64 61 74 61 20 6d 75 6c 74 69 2d 73 65 63 74 6f |data multi-secto| 00001360 72 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 |r |.| | 00001370 20 20 26 35 32 20 20 20 7c 20 20 20 20 32 20 20 | &52 | 2 | 00001380 20 7c 20 20 59 65 73 20 7c 20 52 65 61 64 20 64 | | Yes | Read d| 00001390 61 74 61 20 31 32 38 20 62 79 74 65 73 20 20 20 |ata 128 bytes | 000013a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000013b0 20 20 20 20 7c 0d 7c 20 20 20 26 35 33 20 20 20 | |.| &53 | 000013c0 7c 20 20 20 20 33 20 20 20 7c 20 20 59 65 73 20 || 3 | Yes | 000013d0 7c 20 52 65 61 64 20 64 61 74 61 20 6d 75 6c 74 || Read data mult| 000013e0 69 2d 73 65 63 74 6f 72 20 20 20 20 20 20 20 20 |i-sector | 000013f0 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 | |.| | 00001400 20 20 26 35 36 20 20 20 7c 20 20 20 20 32 20 20 | &56 | 2 | 00001410 20 7c 20 20 59 65 73 20 7c 20 52 65 61 64 20 64 | | Yes | Read d| 00001420 61 74 61 20 61 6e 64 20 64 65 6c 65 74 65 64 20 |ata and deleted | 00001430 64 61 74 61 20 31 32 38 20 62 79 74 65 73 20 20 |data 128 bytes | 00001440 20 20 20 20 7c 0d 7c 20 20 20 26 35 37 20 20 20 | |.| &57 | 00001450 7c 20 20 20 20 33 20 20 20 7c 20 20 59 65 73 20 || 3 | Yes | 00001460 7c 20 52 65 61 64 20 64 61 74 61 20 61 6e 64 20 || Read data and | 00001470 64 65 6c 65 74 65 64 20 64 61 74 61 20 6d 75 6c |deleted data mul| 00001480 74 69 2d 73 65 63 74 6f 72 20 20 20 7c 0d 7c 20 |ti-sector |.| | 00001490 20 20 26 35 42 20 20 20 7c 20 20 20 20 33 20 20 | &5B | 3 | 000014a0 20 7c 20 20 59 65 73 20 7c 20 52 65 61 64 20 73 | | Yes | Read s| 000014b0 65 63 74 6f 72 20 69 64 73 20 20 20 20 20 20 20 |ector ids | 000014c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000014d0 20 20 20 20 7c 0d 7c 20 20 20 26 35 45 20 20 20 | |.| &5E | 000014e0 7c 20 20 20 20 32 20 20 20 7c 20 20 59 65 73 20 || 2 | Yes | 000014f0 7c 20 56 65 72 69 66 79 20 64 61 74 61 20 61 6e || Verify data an| 00001500 64 20 64 65 6c 65 74 65 64 20 64 61 74 61 20 31 |d deleted data 1| 00001510 32 38 20 62 79 74 65 73 20 20 20 20 7c 0d 7c 20 |28 bytes |.| | 00001520 20 20 26 35 46 20 20 20 7c 20 20 20 20 33 20 20 | &5F | 3 | 00001530 20 7c 20 20 59 65 73 20 7c 20 56 65 72 69 66 79 | | Yes | Verify| 00001540 20 64 61 74 61 20 61 6e 64 20 64 65 6c 65 74 65 | data and delete| 00001550 64 20 64 61 74 61 20 6d 75 6c 74 69 2d 73 65 63 |d data multi-sec| 00001560 74 6f 72 20 7c 0d 7c 20 20 20 26 36 33 20 20 20 |tor |.| &63 | 00001570 7c 20 20 20 20 35 20 20 20 7c 20 20 59 65 73 20 || 5 | Yes | 00001580 7c 20 46 6f 72 6d 61 74 20 74 72 61 63 6b 20 20 || Format track | 00001590 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000015a0 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 | |.| | 000015b0 20 20 26 36 39 20 20 20 7c 20 20 20 20 31 20 20 | &69 | 1 | 000015c0 20 7c 20 20 59 65 73 20 7c 20 53 65 65 6b 20 20 | | Yes | Seek | 000015d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000015f0 20 20 20 20 7c 0d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d | |.+---------| 00001600 2b 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d |+--------+------| 00001610 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |+---------------| 00001620 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001630 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 7c 20 |------------+.| | 00001640 20 20 26 36 43 20 20 20 7c 20 20 20 20 30 20 20 | &6C | 0 | 00001650 20 7c 20 50 61 72 74 20 7c 20 52 65 61 64 20 64 | | Part | Read d| 00001660 72 69 76 65 20 73 74 61 74 75 73 20 20 20 20 20 |rive status | 00001670 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001680 20 20 20 20 7c 0d 7c 20 20 20 26 37 35 20 20 20 | |.| &75 | 00001690 7c 20 20 20 20 34 20 20 20 7c 20 50 61 72 74 20 || 4 | Part | 000016a0 7c 20 49 6e 69 74 69 61 6c 69 73 65 20 38 32 37 || Initialise 827| 000016b0 31 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |1 | 000016c0 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 | |.| | 000016d0 20 20 26 37 35 20 20 20 7c 20 20 20 20 34 20 20 | &75 | 4 | 000016e0 20 7c 20 50 61 72 74 20 7c 20 4c 6f 61 64 20 62 | | Part | Load b| 000016f0 61 64 20 74 72 61 63 6b 73 20 20 20 20 20 20 20 |ad tracks | 00001700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001710 20 20 20 20 7c 0d 7c 20 20 20 26 37 41 20 20 20 | |.| &7A | 00001720 7c 20 20 20 20 32 20 20 20 7c 20 50 61 72 74 20 || 2 | Part | 00001730 7c 20 57 72 69 74 65 20 73 70 65 63 69 61 6c 20 || Write special | 00001740 72 65 67 69 73 74 65 72 20 20 20 20 20 20 20 20 |register | 00001750 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 7c 20 | |.| | 00001760 20 20 26 37 44 20 20 20 7c 20 20 20 20 31 20 20 | &7D | 1 | 00001770 20 7c 20 50 61 72 74 20 7c 20 52 65 61 64 20 73 | | Part | Read s| 00001780 70 65 63 69 61 6c 20 72 65 67 69 73 74 65 72 20 |pecial register | 00001790 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000017a0 20 20 20 20 7c 0d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d | |.+---------| 000017b0 2b 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d |+--------+------| 000017c0 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |+---------------| 000017d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000017e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0d 20 |------------+.. | 000017f0 20 20 20 20 20 20 20 20 20 20 20 20 20 46 69 67 | Fig| 00001800 75 72 65 20 31 2e 20 54 68 65 20 4f 73 77 6f 72 |ure 1. The Oswor| 00001810 64 20 26 37 46 20 63 6f 6d 6d 61 6e 64 20 73 65 |d &7F command se| 00001820 74 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |t. | 00001830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001850 2d 2d 2d 2d 0d 0d 0d 4f 73 77 6f 72 64 20 26 37 |----...Osword &7| 00001860 46 20 75 73 65 73 20 61 20 76 61 72 69 61 62 6c |F uses a variabl| 00001870 65 20 6c 65 6e 67 74 68 20 70 61 72 61 6d 65 74 |e length paramet| 00001880 65 72 20 62 6c 6f 63 6b 20 74 68 65 20 61 64 64 |er block the add| 00001890 72 65 73 73 20 6f 66 20 77 68 69 63 68 20 69 73 |ress of which is| 000018a0 0d 73 70 65 63 69 66 69 65 64 20 62 79 20 74 68 |.specified by th| 000018b0 65 20 58 20 61 6e 64 20 59 20 72 65 67 69 73 74 |e X and Y regist| 000018c0 65 72 73 20 6f 6e 20 65 6e 74 72 79 2e 0d 0d 42 |ers on entry...B| 000018d0 79 74 65 20 26 30 30 20 6f 66 20 74 68 65 20 70 |yte &00 of the p| 000018e0 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 69 |arameter block i| 000018f0 73 20 75 73 65 64 20 74 6f 20 73 74 6f 72 65 20 |s used to store | 00001900 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 |the number of th| 00001910 65 20 64 69 73 63 0d 64 72 69 76 65 20 74 6f 20 |e disc.drive to | 00001920 62 65 20 75 73 65 64 20 77 69 74 68 20 74 68 65 |be used with the| 00001930 20 63 6f 6d 6d 61 6e 64 2e 20 49 66 20 61 20 6e | command. If a n| 00001940 65 67 61 74 69 76 65 20 64 72 69 76 65 20 6e 75 |egative drive nu| 00001950 6d 62 65 72 20 69 73 20 75 73 65 64 20 28 26 38 |mber is used (&8| 00001960 30 0d 74 6f 20 26 46 46 29 20 74 68 65 6e 20 4f |0.to &FF) then O| 00001970 73 77 6f 72 64 20 26 37 46 20 75 73 65 73 20 74 |sword &7F uses t| 00001980 68 65 20 63 75 72 72 65 6e 74 6c 79 20 73 65 6c |he currently sel| 00001990 65 63 74 65 64 20 64 72 69 76 65 20 61 73 20 73 |ected drive as s| 000019a0 70 65 63 69 66 69 65 64 20 62 79 0d 74 68 65 20 |pecified by.the | 000019b0 6d 6f 73 74 20 72 65 63 65 6e 74 20 2a 44 52 49 |most recent *DRI| 000019c0 56 45 20 63 6f 6d 6d 61 6e 64 2e 0d 0d 42 79 74 |VE command...Byt| 000019d0 65 73 20 26 30 31 20 74 6f 20 26 30 34 20 6f 66 |es &01 to &04 of| 000019e0 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 20 62 | the parameter b| 000019f0 6c 6f 63 6b 20 73 74 6f 72 65 20 74 68 65 20 61 |lock store the a| 00001a00 64 64 72 65 73 73 20 6f 66 20 61 20 62 75 66 66 |ddress of a buff| 00001a10 65 72 20 61 72 65 61 0d 69 6e 74 6f 20 77 68 69 |er area.into whi| 00001a20 63 68 20 61 6e 79 20 64 61 74 61 20 74 6f 20 62 |ch any data to b| 00001a30 65 20 72 65 61 64 20 77 69 6c 6c 20 62 65 20 70 |e read will be p| 00001a40 6c 61 63 65 64 2c 20 6f 72 20 66 72 6f 6d 20 77 |laced, or from w| 00001a50 68 69 63 68 20 61 6e 79 20 64 61 74 61 20 74 6f |hich any data to| 00001a60 0d 62 65 20 77 72 69 74 74 65 6e 20 77 69 6c 6c |.be written will| 00001a70 20 62 65 20 74 61 6b 65 6e 2e 20 41 20 62 75 66 | be taken. A buf| 00001a80 66 65 72 20 69 73 20 6e 6f 74 20 6e 65 65 64 65 |fer is not neede| 00001a90 64 20 62 79 20 61 6c 6c 20 74 68 65 20 63 6f 6d |d by all the com| 00001aa0 6d 61 6e 64 73 20 62 75 74 0d 62 79 74 65 73 20 |mands but.bytes | 00001ab0 26 30 31 20 74 6f 20 26 30 34 20 6f 66 20 74 68 |&01 to &04 of th| 00001ac0 65 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 |e parameter bloc| 00001ad0 6b 20 61 72 65 20 61 6c 77 61 79 73 20 61 73 73 |k are always ass| 00001ae0 69 67 6e 65 64 20 74 6f 20 61 20 62 75 66 66 65 |igned to a buffe| 00001af0 72 0d 61 64 64 72 65 73 73 20 65 76 65 6e 20 69 |r.address even i| 00001b00 66 20 61 20 62 75 66 66 65 72 20 69 73 20 6e 6f |f a buffer is no| 00001b10 74 20 75 73 65 64 2e 0d 0d 43 6f 6c 75 6d 6e 20 |t used...Column | 00001b20 32 20 6f 66 20 66 69 67 75 72 65 20 31 20 73 68 |2 of figure 1 sh| 00001b30 6f 77 73 20 74 68 61 74 20 74 68 65 20 4f 73 77 |ows that the Osw| 00001b40 6f 72 64 20 26 37 46 20 63 6f 6d 6d 61 6e 64 73 |ord &7F commands| 00001b50 20 75 73 65 20 66 72 6f 6d 20 30 20 74 6f 20 35 | use from 0 to 5| 00001b60 0d 70 61 72 61 6d 65 74 65 72 73 2e 20 54 68 65 |.parameters. The| 00001b70 20 6e 75 6d 62 65 72 20 6f 66 20 70 61 72 61 6d | number of param| 00001b80 65 74 65 72 73 20 75 73 65 64 20 62 79 20 61 20 |eters used by a | 00001b90 63 61 6c 6c 20 69 73 20 73 74 6f 72 65 64 20 69 |call is stored i| 00001ba0 6e 20 62 79 74 65 20 26 30 35 0d 6f 66 20 69 74 |n byte &05.of it| 00001bb0 73 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 |s parameter bloc| 00001bc0 6b 2e 20 42 79 74 65 20 26 30 36 20 6f 66 20 74 |k. Byte &06 of t| 00001bd0 68 65 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f |he parameter blo| 00001be0 63 6b 20 73 74 6f 72 65 73 20 74 68 65 20 63 6f |ck stores the co| 00001bf0 6d 6d 61 6e 64 0d 6e 75 6d 62 65 72 20 28 63 6f |mmand.number (co| 00001c00 6c 75 6d 6e 20 31 2c 20 66 69 67 75 72 65 20 31 |lumn 1, figure 1| 00001c10 29 2c 20 61 6e 64 20 62 79 74 65 20 26 30 37 20 |), and byte &07 | 00001c20 6f 6e 77 61 72 64 73 20 74 68 65 20 70 61 72 61 |onwards the para| 00001c30 6d 65 74 65 72 73 20 72 65 71 75 69 72 65 64 0d |meters required.| 00001c40 62 79 20 74 68 65 20 63 6f 6d 6d 61 6e 64 2e 20 |by the command. | 00001c50 54 68 65 20 6c 61 73 74 20 62 79 74 65 20 6f 66 |The last byte of| 00001c60 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 20 62 | the parameter b| 00001c70 6c 6f 63 6b 20 69 73 20 61 20 72 65 73 75 6c 74 |lock is a result| 00001c80 20 62 79 74 65 2e 0d 55 6e 6c 65 73 73 20 69 74 | byte..Unless it| 00001c90 20 69 73 20 75 73 65 64 20 74 6f 20 72 65 61 64 | is used to read| 00001ca0 20 74 68 65 20 38 32 37 31 20 72 65 67 69 73 74 | the 8271 regist| 00001cb0 65 72 73 2c 20 4f 73 77 6f 72 64 20 26 37 46 20 |ers, Osword &7F | 00001cc0 77 69 6c 6c 20 6e 6f 72 6d 61 6c 6c 79 0d 72 65 |will normally.re| 00001cd0 74 75 72 6e 20 74 68 65 20 6e 75 6d 62 65 72 20 |turn the number | 00001ce0 7a 65 72 6f 20 69 6e 20 74 68 65 20 72 65 73 75 |zero in the resu| 00001cf0 6c 74 20 62 79 74 65 20 77 68 65 6e 20 61 20 63 |lt byte when a c| 00001d00 6f 6d 6d 61 6e 64 20 68 61 73 20 62 65 65 6e 20 |ommand has been | 00001d10 65 78 65 63 75 74 65 64 0d 73 75 63 65 73 73 66 |executed.sucessf| 00001d20 75 6c 6c 79 20 62 75 74 20 69 74 20 72 65 74 75 |ully but it retu| 00001d30 72 6e 73 20 74 68 65 20 6e 75 6d 62 65 72 20 26 |rns the number &| 00001d40 32 30 20 28 69 65 2e 20 62 69 74 20 35 20 73 65 |20 (ie. bit 5 se| 00001d50 74 29 20 69 66 20 64 65 6c 65 74 65 64 20 64 61 |t) if deleted da| 00001d60 74 61 0d 68 61 76 65 20 62 65 65 6e 20 73 75 63 |ta.have been suc| 00001d70 65 73 73 66 75 6c 6c 79 20 77 72 69 74 74 65 6e |essfully written| 00001d80 20 74 6f 2c 20 72 65 61 64 20 66 72 6f 6d 2c 20 | to, read from, | 00001d90 6f 72 20 76 65 72 69 66 69 65 64 20 6f 6e 20 61 |or verified on a| 00001da0 20 64 69 73 63 2e 0d 0d 54 68 65 20 72 65 73 75 | disc...The resu| 00001db0 6c 74 20 69 73 20 72 65 74 75 72 6e 65 64 20 69 |lt is returned i| 00001dc0 6e 20 62 79 74 65 20 26 30 37 20 6f 66 20 74 68 |n byte &07 of th| 00001dd0 65 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 |e parameter bloc| 00001de0 6b 20 66 6f 72 20 4f 73 77 6f 72 64 20 26 37 46 |k for Osword &7F| 00001df0 0d 63 6f 6d 6d 61 6e 64 20 6e 75 6d 62 65 72 20 |.command number | 00001e00 26 36 43 2c 20 77 68 69 63 68 20 75 73 65 73 20 |&6C, which uses | 00001e10 6e 6f 20 70 61 72 61 6d 65 74 65 72 73 2e 20 49 |no parameters. I| 00001e20 74 20 69 73 20 72 65 74 75 72 6e 65 64 20 69 6e |t is returned in| 00001e30 20 62 79 74 65 20 26 30 38 0d 6f 66 20 74 68 65 | byte &08.of the| 00001e40 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b | parameter block| 00001e50 20 66 6f 72 20 63 6f 6d 6d 61 6e 64 20 6e 75 6d | for command num| 00001e60 62 65 72 73 20 26 36 39 20 61 6e 64 20 26 37 44 |bers &69 and &7D| 00001e70 2c 20 77 68 69 63 68 20 75 73 65 20 6f 6e 65 0d |, which use one.| 00001e80 70 61 72 61 6d 65 74 65 72 2c 20 61 6e 64 20 73 |parameter, and s| 00001e90 6f 20 6f 6e 20 75 70 20 74 6f 20 62 79 74 65 20 |o on up to byte | 00001ea0 26 30 43 20 6f 66 20 74 68 65 20 70 61 72 61 6d |&0C of the param| 00001eb0 65 74 65 72 20 62 6c 6f 63 6b 20 66 6f 72 20 63 |eter block for c| 00001ec0 6f 6d 6d 61 6e 64 0d 6e 75 6d 62 65 72 20 26 36 |ommand.number &6| 00001ed0 33 20 77 68 69 63 68 20 75 73 65 73 20 35 20 70 |3 which uses 5 p| 00001ee0 61 72 61 6d 65 74 65 72 73 2e 0d 0d 45 72 72 6f |arameters...Erro| 00001ef0 72 73 20 61 72 65 20 72 65 70 6f 72 74 65 64 20 |rs are reported | 00001f00 69 6e 20 62 69 74 73 20 31 20 74 6f 20 34 20 6f |in bits 1 to 4 o| 00001f10 66 20 74 68 65 20 72 65 73 75 6c 74 20 62 79 74 |f the result byt| 00001f20 65 2e 20 54 68 65 20 65 72 72 6f 72 20 63 6f 64 |e. The error cod| 00001f30 65 73 20 63 61 6e 0d 62 65 20 69 73 6f 6c 61 74 |es can.be isolat| 00001f40 65 64 20 62 79 20 41 4e 44 69 6e 67 20 74 68 65 |ed by ANDing the| 00001f50 20 72 65 73 75 6c 74 20 62 79 74 65 20 77 69 74 | result byte wit| 00001f60 68 20 23 26 31 45 20 61 6e 64 20 74 68 65 20 65 |h #&1E and the e| 00001f70 72 72 6f 72 20 63 6f 64 65 73 20 63 61 6e 20 62 |rror codes can b| 00001f80 65 0d 69 6e 74 65 72 70 72 65 74 65 64 20 61 73 |e.interpreted as| 00001f90 20 73 68 6f 77 6e 20 69 6e 20 66 69 67 75 72 65 | shown in figure| 00001fa0 20 32 2e 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 | 2.... | 00001fb0 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d | +--------+---| 00001fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001fd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 20 20 20 20 20 |---------+. | 00001fe0 20 20 20 20 20 20 20 20 7c 20 52 65 73 75 6c 74 | | Result| 00001ff0 20 7c 20 49 6e 74 65 72 70 72 65 74 61 74 69 6f | | Interpretatio| 00002000 6e 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d |n |.| 00002010 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2d 2d | +--| 00002020 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d |------+---------| 00002030 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00002040 2d 2d 2d 2b 0d 20 20 20 20 20 20 20 20 20 20 20 |---+. | 00002050 20 20 7c 20 20 26 30 32 20 20 20 7c 20 53 63 61 | | &02 | Sca| 00002060 6e 20 6d 65 74 20 65 71 75 61 6c 20 2a 2a 20 20 |n met equal ** | 00002070 20 20 20 20 20 20 20 20 7c 0d 20 20 20 20 20 20 | |. | 00002080 20 20 20 20 20 20 20 7c 20 20 26 30 34 20 20 20 | | &04 | 00002090 7c 20 53 63 61 6e 20 6d 65 74 20 6e 6f 74 20 65 || Scan met not e| 000020a0 71 75 61 6c 20 2a 2a 20 20 20 20 20 20 7c 0d 20 |qual ** |. | 000020b0 20 20 20 20 20 20 20 20 20 20 20 20 7c 20 20 26 | | &| 000020c0 30 38 20 20 20 7c 20 43 6c 6f 63 6b 20 65 72 72 |08 | Clock err| 000020d0 6f 72 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |or | 000020e0 20 20 7c 0d 20 20 20 20 20 20 20 20 20 20 20 20 | |. | 000020f0 20 7c 20 20 26 30 41 20 20 20 7c 20 4c 61 74 65 | | &0A | Late| 00002100 20 44 4d 41 20 2a 2a 20 20 20 20 20 20 20 20 20 | DMA ** | 00002110 20 20 20 20 20 20 20 7c 0d 20 20 20 20 20 20 20 | |. | 00002120 20 20 20 20 20 20 7c 20 20 26 30 43 20 20 20 7c | | &0C || 00002130 20 53 65 63 74 6f 72 20 49 44 20 43 52 43 20 65 | Sector ID CRC e| 00002140 72 72 6f 72 20 20 20 20 20 20 20 20 7c 0d 20 20 |rror |. | 00002150 20 20 20 20 20 20 20 20 20 20 20 7c 20 20 26 30 | | &0| 00002160 45 20 20 20 7c 20 44 61 74 61 20 43 52 43 20 65 |E | Data CRC e| 00002170 72 72 6f 72 20 20 20 20 20 20 20 20 20 20 20 20 |rror | 00002180 20 7c 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 | |. | 00002190 7c 20 20 26 31 30 20 20 20 7c 20 44 72 69 76 65 || &10 | Drive| 000021a0 20 6e 6f 74 20 72 65 61 64 79 20 20 20 20 20 20 | not ready | 000021b0 20 20 20 20 20 20 7c 0d 20 20 20 20 20 20 20 20 | |. | 000021c0 20 20 20 20 20 7c 20 20 26 31 32 20 20 20 7c 20 | | &12 | | 000021d0 44 69 73 63 20 77 72 69 74 65 20 70 72 6f 74 65 |Disc write prote| 000021e0 63 74 65 64 20 20 20 20 20 20 20 7c 0d 20 20 20 |cted |. | 000021f0 20 20 20 20 20 20 20 20 20 20 7c 20 20 26 31 34 | | &14| 00002200 20 20 20 7c 20 50 68 79 73 69 63 61 6c 20 74 72 | | Physical tr| 00002210 61 63 6b 20 30 20 6e 6f 74 20 66 6f 75 6e 64 20 |ack 0 not found | 00002220 7c 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 7c ||. || 00002230 20 20 26 31 36 20 20 20 7c 20 57 72 69 74 65 20 | &16 | Write | 00002240 66 61 75 6c 74 20 20 20 20 20 20 20 20 20 20 20 |fault | 00002250 20 20 20 20 20 7c 0d 20 20 20 20 20 20 20 20 20 | |. | 00002260 20 20 20 20 7c 20 20 26 31 38 20 20 20 7c 20 53 | | &18 | S| 00002270 65 63 74 6f 72 20 6e 6f 74 20 66 6f 75 6e 64 20 |ector not found | 00002280 20 20 20 20 20 20 20 20 20 20 7c 0d 20 20 20 20 | |. | 00002290 20 20 20 20 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d | +------| 000022a0 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |--+-------------| 000022b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 000022c0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 20 |. | | 000022d0 20 45 72 72 6f 72 73 20 6d 61 72 6b 65 64 20 2a | Errors marked *| 000022e0 2a 20 73 68 6f 75 6c 64 20 6e 6f 74 20 6f 63 63 |* should not occ| 000022f0 75 72 20 20 7c 0d 20 20 20 20 20 20 20 20 20 20 |ur |. | 00002300 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +------------| 00002310 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00002320 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0d 20 20 20 20 |---------+.. | 00002330 20 20 20 46 69 67 75 72 65 20 32 2e 20 54 68 65 | Figure 2. The| 00002340 20 65 72 72 6f 72 20 63 6f 64 65 73 20 72 65 74 | error codes ret| 00002350 75 72 6e 65 64 20 69 6e 20 74 68 65 20 72 65 73 |urned in the res| 00002360 75 6c 74 20 62 79 74 65 0d 20 20 20 20 20 20 20 |ult byte. | 00002370 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000023a0 2d 2d 2d 2d 2d 0d 0d 0d 57 68 65 6e 20 64 65 73 |-----...When des| 000023b0 69 67 6e 69 6e 67 20 73 6f 66 74 77 61 72 65 20 |igning software | 000023c0 77 68 69 63 68 20 75 73 65 73 20 4f 73 77 6f 72 |which uses Oswor| 000023d0 64 20 26 37 46 20 79 6f 75 20 63 61 6e 20 74 65 |d &7F you can te| 000023e0 73 74 20 74 68 65 20 72 65 73 75 6c 74 20 62 79 |st the result by| 000023f0 74 65 0d 66 6f 72 20 73 70 65 63 69 66 69 63 20 |te.for specific | 00002400 65 72 72 6f 72 73 20 61 66 74 65 72 20 41 4e 44 |errors after AND| 00002410 69 6e 67 20 74 68 65 20 72 65 73 75 6c 74 20 77 |ing the result w| 00002420 69 74 68 20 23 26 31 45 20 74 6f 20 69 73 6f 6c |ith #&1E to isol| 00002430 61 74 65 20 74 68 65 20 65 72 72 6f 72 0d 62 69 |ate the error.bi| 00002440 74 73 2e 20 41 4e 44 69 6e 67 20 77 69 74 68 20 |ts. ANDing with | 00002450 23 26 31 45 20 65 78 63 6c 75 64 65 73 20 74 68 |#&1E excludes th| 00002460 65 20 64 65 6c 65 74 65 64 20 64 61 74 61 20 62 |e deleted data b| 00002470 69 74 20 77 68 69 63 68 20 69 73 20 6e 6f 74 20 |it which is not | 00002480 72 65 61 6c 6c 79 0d 61 6e 20 65 72 72 6f 72 20 |really.an error | 00002490 61 74 20 61 6c 6c 2e 20 54 65 73 74 69 6e 67 20 |at all. Testing | 000024a0 66 6f 72 20 73 70 65 63 69 66 69 63 20 65 72 72 |for specific err| 000024b0 6f 72 73 20 69 73 20 6e 6f 74 20 65 73 73 65 6e |ors is not essen| 000024c0 74 69 61 6c 20 62 65 63 61 75 73 65 20 61 6c 6c |tial because all| 000024d0 0d 74 68 65 20 61 62 6f 76 65 20 65 72 72 6f 72 |.the above error| 000024e0 73 20 61 72 65 20 66 61 74 61 6c 20 61 6e 64 20 |s are fatal and | 000024f0 61 6e 79 20 65 72 72 6f 72 20 73 68 6f 75 6c 64 |any error should| 00002500 20 62 65 20 75 73 65 64 20 74 6f 20 68 61 6c 74 | be used to halt| 00002510 20 79 6f 75 72 0d 70 72 6f 67 72 61 6d 2e 20 54 | your.program. T| 00002520 65 73 74 69 6e 67 20 66 6f 72 20 73 70 65 63 69 |esting for speci| 00002530 66 69 63 20 65 72 72 6f 72 73 20 63 61 6e 20 61 |fic errors can a| 00002540 6c 77 61 79 73 20 67 69 76 65 20 73 6f 6d 65 20 |lways give some | 00002550 75 73 65 66 75 6c 20 65 78 74 72 61 0d 69 6e 66 |useful extra.inf| 00002560 6f 72 6d 61 74 69 6f 6e 20 77 68 65 6e 20 61 20 |ormation when a | 00002570 72 6f 75 74 69 6e 65 20 66 61 69 6c 73 20 74 6f |routine fails to| 00002580 20 77 6f 72 6b 20 61 73 20 65 78 70 65 63 74 65 | work as expecte| 00002590 64 2e 0d 0d 49 6e 20 74 68 65 20 72 65 73 74 20 |d...In the rest | 000025a0 6f 66 20 74 68 69 73 20 6d 6f 64 75 6c 65 20 61 |of this module a| 000025b0 6e 64 20 77 68 6f 6c 65 20 6f 66 20 74 68 65 20 |nd whole of the | 000025c0 6e 65 78 74 20 6d 6f 64 75 6c 65 20 49 20 77 69 |next module I wi| 000025d0 6c 6c 20 64 69 73 63 75 73 73 20 74 68 65 0d 63 |ll discuss the.c| 000025e0 6f 6d 6d 61 6e 64 73 20 65 78 65 63 75 74 65 64 |ommands executed| 000025f0 20 62 79 20 4f 73 77 6f 72 64 20 26 37 46 20 61 | by Osword &7F a| 00002600 6e 64 20 67 69 76 65 20 73 68 6f 72 74 20 65 78 |nd give short ex| 00002610 61 6d 70 6c 65 73 20 6f 66 20 74 68 65 20 73 6f |amples of the so| 00002620 6d 65 20 6f 66 0d 74 68 65 6d 2e 20 4c 61 74 65 |me of.them. Late| 00002630 72 20 69 6e 20 74 68 65 20 73 65 72 69 65 73 20 |r in the series | 00002640 74 68 65 73 65 20 63 6f 6d 6d 61 6e 64 73 20 77 |these commands w| 00002650 69 6c 6c 20 62 65 20 75 73 65 64 20 74 6f 20 73 |ill be used to s| 00002660 68 6f 77 20 79 6f 75 20 68 6f 77 20 74 6f 0d 63 |how you how to.c| 00002670 72 65 61 74 65 20 64 69 73 63 20 75 74 69 6c 69 |reate disc utili| 00002680 74 79 20 70 72 6f 67 72 61 6d 73 2e 0d 0d 54 68 |ty programs...Th| 00002690 65 20 6f 72 64 65 72 20 69 6e 20 77 68 69 63 68 |e order in which| 000026a0 20 74 68 65 20 63 6f 6d 6d 61 6e 64 73 20 77 69 | the commands wi| 000026b0 6c 6c 20 62 65 20 64 69 73 63 75 73 73 65 64 20 |ll be discussed | 000026c0 69 73 20 6e 6f 74 20 74 68 65 20 6f 72 64 65 72 |is not the order| 000026d0 20 69 6e 0d 77 68 69 63 68 20 74 68 65 79 20 61 | in.which they a| 000026e0 72 65 20 6c 69 73 74 65 64 20 69 6e 20 66 69 67 |re listed in fig| 000026f0 75 72 65 20 31 2e 20 49 20 77 69 6c 6c 20 63 6f |ure 1. I will co| 00002700 76 65 72 20 74 68 65 20 4f 73 77 6f 72 64 20 26 |ver the Osword &| 00002710 37 46 20 63 6f 6d 6d 61 6e 64 0d 6e 75 6d 62 65 |7F command.numbe| 00002720 72 73 20 26 36 39 20 74 6f 20 26 37 44 20 69 6e |rs &69 to &7D in| 00002730 20 74 68 69 73 20 6d 6f 64 75 6c 65 2e 20 57 69 | this module. Wi| 00002740 74 68 20 74 68 65 20 65 78 63 65 70 74 69 6f 6e |th the exception| 00002750 20 6f 66 20 74 68 65 20 53 65 65 6b 20 63 6f 6d | of the Seek com| 00002760 6d 61 6e 64 2c 0d 74 68 65 73 65 20 63 6f 6d 6d |mand,.these comm| 00002770 61 6e 64 73 20 61 72 65 20 6e 6f 74 20 66 75 6c |ands are not ful| 00002780 79 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 77 69 |y implemented wi| 00002790 74 68 20 74 68 65 20 31 37 37 30 20 64 69 73 63 |th the 1770 disc| 000027a0 20 69 6e 74 65 72 66 61 63 65 20 62 75 74 0d 74 | interface but.t| 000027b0 68 65 79 20 61 72 65 20 65 66 66 65 63 74 69 76 |hey are effectiv| 000027c0 6c 79 20 69 6e 63 6f 72 70 6f 72 61 74 65 64 20 |ly incorporated | 000027d0 69 6e 20 6f 74 68 65 72 20 63 6f 6d 6d 61 6e 64 |in other command| 000027e0 73 20 73 75 63 68 20 61 73 20 57 72 69 74 65 20 |s such as Write | 000027f0 44 61 74 61 2c 0d 52 65 61 64 20 44 61 74 61 2c |Data,.Read Data,| 00002800 20 61 6e 64 20 56 65 72 69 66 79 2e 20 54 68 65 | and Verify. The| 00002810 20 4f 73 77 6f 72 64 20 26 37 46 20 63 6f 6d 6d | Osword &7F comm| 00002820 61 6e 64 20 6e 75 6d 62 65 72 73 20 26 34 41 20 |and numbers &4A | 00002830 74 6f 20 26 36 33 20 77 69 6c 6c 20 62 65 0d 63 |to &63 will be.c| 00002840 6f 76 65 72 65 64 20 69 6e 20 74 68 65 20 6e 65 |overed in the ne| 00002850 78 74 20 6d 6f 64 75 6c 65 2e 0d 0d 0d 2d 2d 2d |xt module....---| 00002860 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00002870 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 4f 73 77 6f 72 64 |---------.Osword| 00002880 20 26 37 46 20 52 65 61 64 20 44 72 69 76 65 20 | &7F Read Drive | 00002890 53 74 61 74 75 73 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d |Status.---------| 000028a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000028b0 2d 2d 2d 0d 0d 54 68 65 20 4f 73 77 6f 72 64 20 |---..The Osword | 000028c0 26 37 46 20 52 65 61 64 20 44 72 69 76 65 20 53 |&7F Read Drive S| 000028d0 74 61 74 75 73 20 63 6f 6d 6d 61 6e 64 20 63 6f |tatus command co| 000028e0 70 69 65 73 20 74 68 65 20 38 32 37 31 20 64 72 |pies the 8271 dr| 000028f0 69 76 65 20 63 6f 6e 74 72 6f 6c 0d 69 6e 70 75 |ive control.inpu| 00002900 74 20 72 65 67 69 73 74 65 72 20 74 6f 20 74 68 |t register to th| 00002910 65 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 |e parameter bloc| 00002920 6b 20 72 65 73 75 6c 74 20 62 79 74 65 2e 20 54 |k result byte. T| 00002930 6f 20 75 73 65 20 74 68 69 73 20 63 6f 6d 6d 61 |o use this comma| 00002940 6e 64 20 73 65 74 0d 75 70 20 74 68 65 20 66 6f |nd set.up the fo| 00002950 6c 6c 6f 77 69 6e 67 20 70 61 72 61 6d 65 74 65 |llowing paramete| 00002960 72 20 62 6c 6f 63 6b 2e 0d 0d 50 61 72 61 6d 65 |r block...Parame| 00002970 74 65 72 20 62 6c 6f 63 6b 20 26 30 30 20 20 20 |ter block &00 | 00002980 20 20 20 20 3d 20 64 72 69 76 65 20 6e 75 6d 62 | = drive numb| 00002990 65 72 20 28 26 30 30 2d 26 30 33 20 6f 72 20 26 |er (&00-&03 or &| 000029a0 46 46 29 0d 50 61 72 61 6d 65 74 65 72 20 62 6c |FF).Parameter bl| 000029b0 6f 63 6b 20 26 30 31 20 2d 20 26 30 34 20 3d 20 |ock &01 - &04 = | 000029c0 62 75 66 66 65 72 20 61 64 64 72 65 73 73 20 28 |buffer address (| 000029d0 6e 6f 74 20 75 73 65 64 29 0d 50 61 72 61 6d 65 |not used).Parame| 000029e0 74 65 72 20 62 6c 6f 63 6b 20 26 30 35 20 20 20 |ter block &05 | 000029f0 20 20 20 20 3d 20 26 30 30 20 28 6e 6f 20 63 6f | = &00 (no co| 00002a00 6d 6d 61 6e 64 20 70 61 72 61 6d 65 74 65 72 73 |mmand parameters| 00002a10 29 0d 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 |).Parameter bloc| 00002a20 6b 20 26 30 36 20 20 20 20 20 20 20 3d 20 26 36 |k &06 = &6| 00002a30 43 20 28 72 65 61 64 20 64 72 69 76 65 20 73 74 |C (read drive st| 00002a40 61 74 75 73 20 63 6f 6d 6d 61 6e 64 29 0d 50 61 |atus command).Pa| 00002a50 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 |rameter block &0| 00002a60 37 20 20 20 20 20 20 20 3d 20 72 65 73 75 6c 74 |7 = result| 00002a70 20 62 79 74 65 0d 0d 0d 45 61 63 68 20 62 69 74 | byte...Each bit| 00002a80 20 6f 66 20 74 68 65 20 72 65 73 75 6c 74 20 62 | of the result b| 00002a90 79 74 65 20 68 61 73 20 74 68 65 20 66 6f 6c 6c |yte has the foll| 00002aa0 6f 77 69 6e 67 20 6d 65 61 6e 69 6e 67 3a 0d 0d |owing meaning:..| 00002ab0 62 69 74 20 37 20 3d 20 75 6e 75 73 65 64 0d 62 |bit 7 = unused.b| 00002ac0 69 74 20 36 20 3d 20 52 45 41 44 59 31 0d 62 69 |it 6 = READY1.bi| 00002ad0 74 20 35 20 3d 20 46 41 55 4c 54 0d 62 69 74 20 |t 5 = FAULT.bit | 00002ae0 34 20 3d 20 49 4e 44 45 58 0d 62 69 74 20 33 20 |4 = INDEX.bit 3 | 00002af0 3d 20 57 52 20 50 52 4f 54 45 43 54 0d 62 69 74 |= WR PROTECT.bit| 00002b00 20 32 20 3d 20 52 45 41 44 59 30 0d 62 69 74 20 | 2 = READY0.bit | 00002b10 31 20 3d 20 54 52 4b 30 0d 62 69 74 20 30 20 3d |1 = TRK0.bit 0 =| 00002b20 20 43 4f 55 4e 54 2f 4f 50 31 0d 0d 0d 54 68 65 | COUNT/OP1...The| 00002b30 73 65 20 72 65 73 75 6c 74 73 20 61 72 65 20 6f |se results are o| 00002b40 6e 6c 79 20 72 65 61 6c 6c 79 20 75 73 65 66 75 |nly really usefu| 00002b50 6c 20 66 6f 72 20 74 72 61 63 6b 69 6e 67 20 64 |l for tracking d| 00002b60 6f 77 6e 20 68 61 72 64 77 61 72 65 20 65 72 72 |own hardware err| 00002b70 6f 72 73 2e 0d 59 6f 75 20 63 61 6e 20 75 73 65 |ors..You can use| 00002b80 20 74 68 65 20 64 65 6d 6f 6e 73 74 72 61 74 69 | the demonstrati| 00002b90 6f 6e 20 70 72 6f 67 72 61 6d 20 53 54 41 54 55 |on program STATU| 00002ba0 53 20 77 69 74 68 20 62 6f 74 68 20 77 72 69 74 |S with both writ| 00002bb0 65 20 70 72 6f 74 65 63 74 65 64 20 61 6e 64 0d |e protected and.| 00002bc0 77 72 69 74 65 20 65 6e 61 62 6c 65 64 20 64 69 |write enabled di| 00002bd0 73 63 73 20 74 6f 20 73 65 65 20 74 68 65 20 65 |scs to see the e| 00002be0 66 66 65 63 74 20 74 68 61 74 20 77 72 69 74 65 |ffect that write| 00002bf0 20 70 72 6f 74 65 63 74 69 6f 6e 20 68 61 73 20 | protection has | 00002c00 6f 6e 20 74 68 65 0d 62 69 74 73 20 6f 66 20 74 |on the.bits of t| 00002c10 68 65 20 72 65 73 75 6c 74 20 72 65 67 69 73 74 |he result regist| 00002c20 65 72 2e 20 59 6f 75 20 63 6f 75 6c 64 20 75 73 |er. You could us| 00002c30 65 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 20 74 |e this command t| 00002c40 6f 20 74 65 73 74 20 66 6f 72 20 61 0d 77 72 69 |o test for a.wri| 00002c50 74 65 20 70 72 6f 74 65 63 74 69 6f 6e 20 74 61 |te protection ta| 00002c60 62 20 6f 6e 20 61 20 64 69 73 63 20 62 75 74 20 |b on a disc but | 00002c70 74 68 65 20 6f 6e 6c 79 20 75 6e 69 71 75 65 20 |the only unique | 00002c80 75 73 65 20 66 6f 72 20 74 68 65 20 4f 73 77 6f |use for the Oswo| 00002c90 72 64 20 26 37 46 0d 52 65 61 64 20 44 72 69 76 |rd &7F.Read Driv| 00002ca0 65 20 53 74 61 74 75 73 20 63 6f 6d 6d 61 6e 64 |e Status command| 00002cb0 20 69 73 20 74 6f 20 63 6c 65 61 72 20 61 20 22 | is to clear a "| 00002cc0 6e 6f 74 20 72 65 61 64 79 22 20 73 69 67 6e 61 |not ready" signa| 00002cd0 6c 2e 20 49 74 20 69 73 20 75 73 65 64 20 62 79 |l. It is used by| 00002ce0 0d 74 68 65 20 44 46 53 20 66 6f 72 20 74 68 69 |.the DFS for thi| 00002cf0 73 20 70 75 72 70 6f 73 65 2e 20 54 68 69 73 20 |s purpose. This | 00002d00 69 73 20 6e 6f 74 20 6f 6e 65 20 6f 66 20 74 68 |is not one of th| 00002d10 65 20 6d 6f 73 74 20 75 73 65 66 75 6c 20 63 6f |e most useful co| 00002d20 6d 6d 61 6e 64 73 20 61 6e 64 0d 79 6f 75 20 77 |mmands and.you w| 00002d30 69 6c 6c 20 70 72 6f 62 61 62 6c 79 20 6e 6f 74 |ill probably not| 00002d40 20 6e 65 65 64 20 74 6f 20 75 73 65 20 69 74 20 | need to use it | 00002d50 69 6e 20 61 6e 79 20 6f 66 20 79 6f 75 72 20 70 |in any of your p| 00002d60 72 6f 67 72 61 6d 73 2e 0d 0d 0d 20 20 20 31 30 |rograms.... 10| 00002d70 20 52 45 4d 3a 20 53 54 41 54 55 53 0d 20 20 20 | REM: STATUS. | 00002d80 32 30 20 6f 73 77 72 63 68 3d 26 46 46 45 45 0d |20 oswrch=&FFEE.| 00002d90 20 20 20 33 30 20 6f 73 77 6f 72 64 3d 26 46 46 | 30 osword=&FF| 00002da0 46 31 0d 20 20 20 34 30 20 44 49 4d 20 6d 63 6f |F1. 40 DIM mco| 00002db0 64 65 20 26 31 30 30 0d 20 20 20 35 30 20 46 4f |de &100. 50 FO| 00002dc0 52 20 70 61 73 73 20 3d 20 30 20 54 4f 20 32 20 |R pass = 0 TO 2 | 00002dd0 53 54 45 50 20 32 0d 20 20 20 36 30 20 50 25 3d |STEP 2. 60 P%=| 00002de0 6d 63 6f 64 65 0d 20 20 20 37 30 20 5b 20 20 20 |mcode. 70 [ | 00002df0 20 20 20 20 4f 50 54 20 70 61 73 73 0d 20 20 20 | OPT pass. | 00002e00 38 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 |80 LDA #| 00002e10 26 37 46 0d 20 20 20 39 30 20 20 20 20 20 20 20 |&7F. 90 | 00002e20 20 20 4c 44 58 20 23 62 6c 6f 63 6b 20 4d 4f 44 | LDX #block MOD| 00002e30 20 32 35 36 0d 20 20 31 30 30 20 20 20 20 20 20 | 256. 100 | 00002e40 20 20 20 4c 44 59 20 23 62 6c 6f 63 6b 20 44 49 | LDY #block DI| 00002e50 56 20 32 35 36 0d 20 20 31 31 30 20 20 20 20 20 |V 256. 110 | 00002e60 20 20 20 20 4a 53 52 20 6f 73 77 6f 72 64 0d 20 | JSR osword. | 00002e70 20 31 32 30 20 20 20 20 20 20 20 20 20 52 54 53 | 120 RTS| 00002e80 0d 20 20 31 33 30 20 2e 62 6c 6f 63 6b 0d 20 20 |. 130 .block. | 00002e90 31 34 30 20 20 20 20 20 20 20 20 20 45 51 55 42 |140 EQUB| 00002ea0 20 26 46 46 20 20 20 20 20 20 5c 20 63 75 72 72 | &FF \ curr| 00002eb0 65 6e 74 20 64 72 69 76 65 0d 20 20 31 35 30 20 |ent drive. 150 | 00002ec0 20 20 20 20 20 20 20 20 45 51 55 44 20 26 30 30 | EQUD &00| 00002ed0 20 20 20 20 20 20 5c 20 64 6f 65 73 20 6e 6f 74 | \ does not| 00002ee0 20 6d 61 74 74 65 72 0d 20 20 31 36 30 20 20 20 | matter. 160 | 00002ef0 20 20 20 20 20 20 45 51 55 42 20 26 30 30 20 20 | EQUB &00 | 00002f00 20 20 20 20 5c 20 30 20 70 61 72 61 6d 65 74 65 | \ 0 paramete| 00002f10 72 73 0d 20 20 31 37 30 20 20 20 20 20 20 20 20 |rs. 170 | 00002f20 20 45 51 55 42 20 26 36 43 20 20 20 20 20 20 5c | EQUB &6C \| 00002f30 20 72 65 61 64 20 73 74 61 74 75 73 20 63 6f 6d | read status com| 00002f40 6d 61 6e 64 0d 20 20 31 38 30 20 2e 72 65 73 75 |mand. 180 .resu| 00002f50 6c 74 0d 20 20 31 39 30 20 20 20 20 20 20 20 20 |lt. 190 | 00002f60 20 45 51 55 42 20 26 30 30 20 20 20 20 20 20 5c | EQUB &00 \| 00002f70 20 72 65 73 75 6c 74 20 62 79 74 65 0d 20 20 32 | result byte. 2| 00002f80 30 30 20 2e 62 69 6e 61 72 79 0d 20 20 32 31 30 |00 .binary. 210| 00002f90 20 20 20 20 20 20 20 20 20 4c 44 58 20 23 38 0d | LDX #8.| 00002fa0 20 20 32 32 30 20 2e 6c 6f 6f 70 0d 20 20 32 33 | 220 .loop. 23| 00002fb0 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 41 |0 LDA #A| 00002fc0 53 43 28 22 30 22 29 0d 20 20 32 34 30 20 20 20 |SC("0"). 240 | 00002fd0 20 20 20 20 20 20 41 53 4c 20 72 65 73 75 6c 74 | ASL result| 00002fe0 0d 20 20 32 35 30 20 20 20 20 20 20 20 20 20 41 |. 250 A| 00002ff0 44 43 20 23 26 30 30 0d 20 20 32 36 30 20 20 20 |DC #&00. 260 | 00003000 20 20 20 20 20 20 4a 53 52 20 6f 73 77 72 63 68 | JSR oswrch| 00003010 0d 20 20 32 37 30 20 20 20 20 20 20 20 20 20 44 |. 270 D| 00003020 45 58 0d 20 20 32 38 30 20 20 20 20 20 20 20 20 |EX. 280 | 00003030 20 42 4e 45 20 6c 6f 6f 70 0d 20 20 32 39 30 20 | BNE loop. 290 | 00003040 20 20 20 20 20 20 20 20 52 54 53 0d 20 20 33 30 | RTS. 30| 00003050 30 20 5d 0d 20 20 33 31 30 20 4e 45 58 54 0d 20 |0 ]. 310 NEXT. | 00003060 20 33 32 30 20 43 41 4c 4c 20 6d 63 6f 64 65 0d | 320 CALL mcode.| 00003070 20 20 33 33 30 20 50 52 49 4e 54 22 52 65 73 75 | 330 PRINT"Resu| 00003080 6c 74 20 3d 20 26 22 3b 7e 3f 72 65 73 75 6c 74 |lt = &";~?result| 00003090 3b 22 2c 20 25 22 3b 0d 20 20 33 34 30 20 43 41 |;", %";. 340 CA| 000030a0 4c 4c 20 62 69 6e 61 72 79 0d 20 20 33 35 30 20 |LL binary. 350 | 000030b0 50 52 49 4e 54 0d 0d 0d 2d 2d 2d 2d 2d 2d 2d 2d |PRINT...--------| 000030c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000030d0 2d 2d 0d 4f 73 77 6f 72 64 20 26 37 46 20 49 6e |--.Osword &7F In| 000030e0 69 74 69 61 6c 69 73 65 20 38 32 37 31 0d 2d 2d |itialise 8271.--| 000030f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003100 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d 4f 73 77 6f 72 64 |--------..Osword| 00003110 20 26 37 46 20 49 6e 69 74 69 61 6c 69 73 65 20 | &7F Initialise | 00003120 38 32 37 31 20 69 73 20 6e 6f 74 20 66 75 6c 6c |8271 is not full| 00003130 79 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 77 69 |y implemented wi| 00003140 74 68 20 74 68 65 20 31 37 37 30 20 64 69 73 63 |th the 1770 disc| 00003150 0d 69 6e 74 65 72 66 61 63 65 2e 20 46 6f 72 20 |.interface. For | 00003160 74 68 69 73 20 72 65 61 73 6f 6e 20 79 6f 75 20 |this reason you | 00003170 73 68 6f 75 6c 64 20 61 76 6f 69 64 20 75 73 69 |should avoid usi| 00003180 6e 67 20 69 74 20 61 6e 64 20 75 73 65 20 74 68 |ng it and use th| 00003190 65 0d 65 71 75 69 76 61 6c 65 6e 74 20 4f 73 62 |e.equivalent Osb| 000031a0 79 74 65 20 26 46 46 20 77 68 69 63 68 20 69 73 |yte &FF which is| 000031b0 20 61 76 61 69 6c 61 62 6c 65 20 66 72 6f 6d 20 | available from | 000031c0 74 68 65 20 6f 70 65 72 61 74 69 6e 67 20 73 79 |the operating sy| 000031d0 73 74 65 6d 20 6f 66 20 61 6c 6c 0d 42 42 43 20 |stem of all.BBC | 000031e0 6d 69 63 72 6f 63 6f 6d 70 75 74 65 72 73 2e 0d |microcomputers..| 000031f0 0d 54 68 65 20 68 61 72 64 77 61 72 65 20 64 65 |.The hardware de| 00003200 66 61 75 6c 74 20 73 65 74 74 69 6e 67 20 69 73 |fault setting is| 00003210 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 20 2a | equivalent to *| 00003220 46 58 20 32 35 35 2c 30 2c 32 35 35 20 61 6e 64 |FX 255,0,255 and| 00003230 20 74 68 69 73 20 67 69 76 65 73 0d 61 63 63 65 | this gives.acce| 00003240 73 73 20 74 6f 20 74 68 65 20 73 6c 6f 77 65 73 |ss to the slowes| 00003250 74 20 64 69 73 63 20 64 72 69 76 65 73 2e 20 54 |t disc drives. T| 00003260 68 65 20 4f 73 62 79 74 65 20 63 61 6c 6c 73 20 |he Osbyte calls | 00003270 69 6e 20 66 69 67 75 72 65 20 33 20 63 61 6e 20 |in figure 3 can | 00003280 62 65 0d 75 73 65 64 20 74 6f 20 67 69 76 65 20 |be.used to give | 00003290 61 63 63 65 73 73 20 74 6f 20 66 61 73 74 65 72 |access to faster| 000032a0 20 64 72 69 76 65 73 20 62 75 74 2c 20 69 66 20 | drives but, if | 000032b0 79 6f 75 20 61 72 65 20 77 72 69 74 69 6e 67 20 |you are writing | 000032c0 73 6f 66 74 77 61 72 65 20 74 6f 0d 62 65 20 75 |software to.be u| 000032d0 73 65 64 20 6f 6e 20 75 6e 6b 6e 6f 77 6e 20 64 |sed on unknown d| 000032e0 72 69 76 65 73 2c 20 69 74 20 6d 61 79 20 62 65 |rives, it may be| 000032f0 20 61 20 67 6f 6f 64 20 69 64 65 61 20 74 6f 20 | a good idea to | 00003300 73 65 6c 65 63 74 20 74 68 65 20 73 6c 6f 77 65 |select the slowe| 00003310 73 74 0d 74 69 6d 65 2e 0d 0d 4f 73 62 79 74 65 |st.time...Osbyte| 00003320 20 26 46 46 20 70 61 73 73 65 73 20 74 68 65 20 | &FF passes the | 00003330 76 61 6c 75 65 73 20 6f 66 20 74 68 65 20 64 72 |values of the dr| 00003340 69 76 65 20 73 74 65 70 20 74 69 6d 65 2c 20 73 |ive step time, s| 00003350 65 74 74 6c 65 6d 65 6e 74 20 74 69 6d 65 2c 20 |ettlement time, | 00003360 61 6e 64 0d 68 65 61 64 20 6c 6f 61 64 20 74 69 |and.head load ti| 00003370 6d 65 20 74 6f 20 74 68 65 20 64 69 73 63 20 63 |me to the disc c| 00003380 6f 6e 74 72 6f 6c 6c 65 72 20 6f 6e 20 73 6f 66 |ontroller on sof| 00003390 74 20 62 72 65 61 6b 20 61 6e 64 20 74 68 65 79 |t break and they| 000033a0 20 77 69 6c 6c 20 72 65 6d 61 69 6e 0d 69 6e 20 | will remain.in | 000033b0 66 6f 72 63 65 20 75 6e 74 69 6c 20 61 20 68 61 |force until a ha| 000033c0 72 64 20 62 72 65 61 6b 2e 0d 0d 0d 20 20 20 20 |rd break.... | 000033d0 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +-----------| 000033e0 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d |+-------------+-| 000033f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d |----------+-----| 00003400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 20 20 20 20 |----------+. | 00003410 20 20 20 20 7c 20 53 74 65 70 20 74 69 6d 65 20 | | Step time | 00003420 7c 20 53 65 74 74 6c 65 20 74 69 6d 65 20 7c 20 || Settle time | | 00003430 4c 6f 61 64 20 74 69 6d 65 20 7c 20 4f 73 62 79 |Load time | Osby| 00003440 74 65 20 26 46 46 20 20 20 20 7c 0d 20 20 20 20 |te &FF |. | 00003450 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +-----------| 00003460 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d |+-------------+-| 00003470 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d |----------+-----| 00003480 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 20 20 20 20 |----------+. | 00003490 20 20 20 20 7c 20 20 20 20 20 20 34 20 20 20 20 | | 4 | 000034a0 7c 20 20 20 20 20 31 36 20 20 20 20 20 20 7c 20 || 16 | | 000034b0 20 20 20 20 20 30 20 20 20 20 7c 20 2a 46 58 20 | 0 | *FX | 000034c0 32 35 35 2c 30 2c 32 30 37 20 7c 0d 20 20 20 20 |255,0,207 |. | 000034d0 20 20 20 20 7c 20 20 20 20 20 20 36 20 20 20 20 | | 6 | 000034e0 7c 20 20 20 20 20 31 36 20 20 20 20 20 20 7c 20 || 16 | | 000034f0 20 20 20 20 20 30 20 20 20 20 7c 20 2a 46 58 20 | 0 | *FX | 00003500 32 35 35 2c 30 2c 32 32 33 20 7c 0d 20 20 20 20 |255,0,223 |. | 00003510 20 20 20 20 7c 20 20 20 20 20 20 36 20 20 20 20 | | 6 | 00003520 7c 20 20 20 20 20 35 30 20 20 20 20 20 20 7c 20 || 50 | | 00003530 20 20 20 20 33 32 20 20 20 20 7c 20 2a 46 58 20 | 32 | *FX | 00003540 32 35 35 2c 30 2c 32 33 39 20 7c 0d 20 20 20 20 |255,0,239 |. | 00003550 20 20 20 20 7c 20 20 20 20 20 32 34 20 20 20 20 | | 24 | 00003560 7c 20 20 20 20 20 32 30 20 20 20 20 20 20 7c 20 || 20 | | 00003570 20 20 20 20 36 34 20 20 20 20 7c 20 2a 46 58 20 | 64 | *FX | 00003580 32 35 35 2c 30 2c 32 35 35 20 7c 0d 20 20 20 20 |255,0,255 |. | 00003590 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +-----------| 000035a0 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d |+-------------+-| 000035b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d |----------+-----| 000035c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0d 20 20 20 |----------+.. | 000035d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000035e0 46 69 67 75 72 65 20 33 2e 20 44 69 73 63 20 61 |Figure 3. Disc a| 000035f0 63 63 65 73 73 20 74 69 6d 69 6e 67 73 0d 20 20 |ccess timings. | 00003600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003610 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | ---------------| 00003620 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d |--------------..| 00003630 0d 49 66 20 79 6f 75 20 6e 65 65 64 20 74 6f 20 |.If you need to | 00003640 75 73 65 20 74 68 65 20 4f 73 77 6f 72 64 20 26 |use the Osword &| 00003650 37 46 20 49 6e 69 74 69 61 6c 69 73 65 20 38 32 |7F Initialise 82| 00003660 37 31 20 63 6f 6d 6d 61 6e 64 20 74 68 65 6e 20 |71 command then | 00003670 74 68 65 0d 66 6f 6c 6c 6f 77 69 6e 67 20 70 61 |the.following pa| 00003680 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 6d 75 |rameter block mu| 00003690 73 74 20 62 65 20 75 73 65 64 2e 0d 0d 50 61 72 |st be used...Par| 000036a0 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 30 |ameter block &00| 000036b0 20 20 20 20 20 20 20 3d 20 64 72 69 76 65 20 6e | = drive n| 000036c0 75 6d 62 65 72 20 28 26 30 30 2d 26 30 33 20 6f |umber (&00-&03 o| 000036d0 72 20 26 46 46 29 0d 50 61 72 61 6d 65 74 65 72 |r &FF).Parameter| 000036e0 20 62 6c 6f 63 6b 20 26 30 31 20 2d 20 26 30 34 | block &01 - &04| 000036f0 20 3d 20 62 75 66 66 65 72 20 61 64 64 72 65 73 | = buffer addres| 00003700 73 20 28 6e 6f 74 20 75 73 65 64 29 0d 50 61 72 |s (not used).Par| 00003710 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 35 |ameter block &05| 00003720 20 20 20 20 20 20 20 3d 20 26 30 34 20 28 34 20 | = &04 (4 | 00003730 63 6f 6d 6d 61 6e 64 20 70 61 72 61 6d 65 74 65 |command paramete| 00003740 72 73 29 0d 50 61 72 61 6d 65 74 65 72 20 62 6c |rs).Parameter bl| 00003750 6f 63 6b 20 26 30 36 20 20 20 20 20 20 20 3d 20 |ock &06 = | 00003760 26 37 35 20 28 69 6e 69 74 69 61 6c 69 73 65 20 |&75 (initialise | 00003770 38 32 37 31 20 63 6f 6d 6d 61 6e 64 29 0d 50 61 |8271 command).Pa| 00003780 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 |rameter block &0| 00003790 37 20 20 20 20 20 20 20 3d 20 26 30 44 20 28 69 |7 = &0D (i| 000037a0 6e 69 74 20 38 32 37 31 20 6d 61 72 6b 65 72 29 |nit 8271 marker)| 000037b0 0d 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b |.Parameter block| 000037c0 20 26 30 38 20 20 20 20 20 20 20 3d 20 64 72 69 | &08 = dri| 000037d0 76 65 20 73 74 65 70 20 74 69 6d 65 20 28 6d 69 |ve step time (mi| 000037e0 6c 6c 69 73 65 63 6f 6e 64 73 20 2f 20 32 29 0d |lliseconds / 2).| 000037f0 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 |Parameter block | 00003800 26 30 39 20 20 20 20 20 20 20 3d 20 68 65 61 64 |&09 = head| 00003810 20 73 65 74 74 6c 65 6d 65 6e 74 20 74 69 6d 65 | settlement time| 00003820 20 28 6d 69 6c 69 73 65 63 6f 6e 64 73 20 2f 20 | (miliseconds / | 00003830 32 29 0d 50 61 72 61 6d 65 74 65 72 20 62 6c 6f |2).Parameter blo| 00003840 63 6b 20 26 30 41 20 20 20 20 20 20 20 3d 20 68 |ck &0A = h| 00003850 65 61 64 20 75 6e 6c 6f 61 64 2f 6c 6f 61 64 20 |ead unload/load | 00003860 74 69 6d 65 20 28 74 77 6f 20 34 20 62 69 74 20 |time (two 4 bit | 00003870 6e 75 6d 62 65 72 73 29 0d 50 61 72 61 6d 65 74 |numbers).Paramet| 00003880 65 72 20 62 6c 6f 63 6b 20 26 30 42 20 20 20 20 |er block &0B | 00003890 20 20 20 3d 20 72 65 73 75 6c 74 20 62 79 74 65 | = result byte| 000038a0 0d 0d 0d 54 68 65 20 64 72 69 76 65 20 73 74 65 |...The drive ste| 000038b0 70 20 74 69 6d 65 20 73 68 6f 75 6c 64 20 62 65 |p time should be| 000038c0 20 69 6e 20 74 68 65 20 72 61 6e 67 65 20 66 72 | in the range fr| 000038d0 6f 6d 20 26 30 31 20 74 6f 20 26 46 46 2c 20 72 |om &01 to &FF, r| 000038e0 65 70 72 65 73 65 6e 74 69 6e 67 20 32 0d 74 6f |epresenting 2.to| 000038f0 20 35 31 30 20 6d 69 6c 6c 69 73 65 63 6f 6e 64 | 510 millisecond| 00003900 73 20 69 6e 20 32 20 6d 69 6c 6c 69 73 65 63 6f |s in 2 milliseco| 00003910 6e 64 20 73 74 65 70 73 2e 20 41 20 64 72 69 76 |nd steps. A driv| 00003920 65 20 73 74 65 70 20 74 69 6d 65 20 6f 66 20 7a |e step time of z| 00003930 65 72 6f 0d 69 6e 64 69 63 61 74 65 73 20 74 68 |ero.indicates th| 00003940 61 74 20 74 68 65 20 64 72 69 76 65 20 77 69 6c |at the drive wil| 00003950 6c 20 70 72 6f 76 69 64 65 20 69 74 73 20 6f 77 |l provide its ow| 00003960 6e 20 73 74 65 70 20 70 75 6c 73 65 73 2e 0d 0d |n step pulses...| 00003970 54 68 65 20 68 65 61 64 20 73 65 74 74 6c 65 6d |The head settlem| 00003980 65 6e 74 20 74 69 6d 65 20 73 68 6f 75 6c 64 20 |ent time should | 00003990 62 65 20 69 6e 20 74 68 65 20 72 61 6e 67 65 20 |be in the range | 000039a0 26 30 30 20 74 6f 20 26 46 46 20 72 65 70 72 65 |&00 to &FF repre| 000039b0 73 65 6e 74 69 6e 67 20 61 0d 64 65 6c 61 79 20 |senting a.delay | 000039c0 6f 66 20 30 20 74 6f 20 35 31 32 20 6d 69 6c 69 |of 0 to 512 mili| 000039d0 73 65 63 6f 6e 64 73 20 69 6e 20 32 20 6d 69 6c |seconds in 2 mil| 000039e0 6c 69 73 65 63 6f 6e 64 20 73 74 65 70 73 2e 0d |lisecond steps..| 000039f0 0d 54 68 65 20 66 6f 75 72 20 6d 6f 73 74 20 73 |.The four most s| 00003a00 69 67 6e 69 66 69 63 61 6e 74 20 62 69 74 73 20 |ignificant bits | 00003a10 6f 66 20 74 68 65 20 68 65 61 64 20 75 6e 6c 6f |of the head unlo| 00003a20 61 64 2f 6c 6f 61 64 20 74 69 6d 65 20 73 68 6f |ad/load time sho| 00003a30 75 6c 64 20 62 65 20 69 6e 0d 74 68 65 20 72 61 |uld be in.the ra| 00003a40 6e 67 65 20 25 30 30 30 30 20 74 6f 20 25 31 31 |nge %0000 to %11| 00003a50 31 30 20 28 30 2d 31 34 29 20 72 65 70 72 65 73 |10 (0-14) repres| 00003a60 65 6e 74 69 6e 67 20 74 68 65 20 6e 75 6d 62 65 |enting the numbe| 00003a70 72 20 6f 66 20 63 6f 6d 70 6c 65 74 65 20 64 69 |r of complete di| 00003a80 73 63 0d 72 65 76 6f 6c 75 74 69 6f 6e 73 20 62 |sc.revolutions b| 00003a90 65 66 6f 72 65 20 74 68 65 20 68 65 61 64 20 69 |efore the head i| 00003aa0 73 20 75 6e 6c 6f 61 64 65 64 2e 20 25 31 31 31 |s unloaded. %111| 00003ab0 31 20 73 70 65 63 69 66 69 65 73 20 74 68 61 74 |1 specifies that| 00003ac0 20 74 68 65 20 68 65 61 64 0d 73 68 6f 75 6c 64 | the head.should| 00003ad0 20 6e 6f 74 20 62 65 20 75 6e 6c 6f 61 64 65 64 | not be unloaded| 00003ae0 20 61 74 20 61 6c 6c 2e 20 54 68 65 20 66 6f 75 | at all. The fou| 00003af0 72 20 6c 65 61 73 74 20 73 69 67 6e 69 66 69 63 |r least signific| 00003b00 61 6e 74 20 62 69 74 73 20 6f 66 20 74 68 65 20 |ant bits of the | 00003b10 68 65 61 64 0d 75 6e 6c 6f 61 64 2f 6c 6f 61 64 |head.unload/load| 00003b20 20 74 69 6d 65 20 73 70 65 63 69 66 79 20 74 68 | time specify th| 00003b30 65 20 74 69 6d 65 20 74 61 6b 65 6e 20 74 6f 20 |e time taken to | 00003b40 6c 6f 61 64 20 74 68 65 20 68 65 61 64 20 69 6e |load the head in| 00003b50 20 38 20 6d 69 6c 69 73 65 63 6f 6e 64 0d 69 6e | 8 milisecond.in| 00003b60 74 65 72 76 61 6c 73 2e 20 54 68 69 73 20 69 73 |tervals. This is| 00003b70 20 61 20 6e 75 6d 62 65 72 20 69 6e 20 74 68 65 | a number in the| 00003b80 20 72 61 6e 67 65 20 25 30 30 30 30 20 74 6f 20 | range %0000 to | 00003b90 25 31 31 31 31 20 28 30 2d 31 35 29 0d 72 65 70 |%1111 (0-15).rep| 00003ba0 72 65 73 65 6e 74 69 6e 67 20 68 65 61 64 20 6c |resenting head l| 00003bb0 6f 61 64 20 74 69 6d 65 73 20 6f 66 20 30 20 74 |oad times of 0 t| 00003bc0 6f 20 31 32 30 20 6d 69 6c 6c 69 73 65 63 6f 6e |o 120 millisecon| 00003bd0 64 73 2e 0d 0d 54 68 65 20 66 6f 6c 6c 6f 77 69 |ds...The followi| 00003be0 6e 67 20 63 6f 64 65 20 63 6f 75 6c 64 20 62 65 |ng code could be| 00003bf0 20 75 73 65 64 20 74 6f 20 69 6e 69 74 69 61 6c | used to initial| 00003c00 69 73 65 20 74 68 65 20 38 32 37 31 2e 0d 0d 0d |ise the 8271....| 00003c10 20 20 20 20 20 20 20 20 4c 44 41 20 23 26 37 46 | LDA #&7F| 00003c20 0d 20 20 20 20 20 20 20 20 4c 44 58 20 23 62 6c |. LDX #bl| 00003c30 6f 63 6b 20 4d 4f 44 20 32 35 36 0d 20 20 20 20 |ock MOD 256. | 00003c40 20 20 20 20 4c 44 59 20 23 62 6c 6f 63 6b 20 44 | LDY #block D| 00003c50 49 56 20 32 35 36 0d 20 20 20 20 20 20 20 20 4a |IV 256. J| 00003c60 53 52 20 26 46 46 46 31 0d 20 20 20 20 20 20 20 |SR &FFF1. | 00003c70 20 52 54 53 0d 2e 62 6c 6f 63 6b 0d 20 20 20 20 | RTS..block. | 00003c80 20 20 20 20 45 51 55 42 20 26 46 46 20 20 20 20 | EQUB &FF | 00003c90 20 20 20 20 20 20 5c 20 63 75 72 72 65 6e 74 20 | \ current | 00003ca0 64 72 69 76 65 0d 20 20 20 20 20 20 20 20 45 51 |drive. EQ| 00003cb0 55 44 20 26 30 30 20 20 20 20 20 20 20 20 20 20 |UD &00 | 00003cc0 5c 20 62 75 66 66 65 72 20 61 64 64 72 65 73 73 |\ buffer address| 00003cd0 20 28 6e 6f 74 20 75 73 65 64 29 0d 20 20 20 20 | (not used). | 00003ce0 20 20 20 20 45 51 55 42 20 26 30 34 20 20 20 20 | EQUB &04 | 00003cf0 20 20 20 20 20 20 5c 20 34 20 70 61 72 61 6d 65 | \ 4 parame| 00003d00 74 65 72 73 0d 20 20 20 20 20 20 20 20 45 51 55 |ters. EQU| 00003d10 42 20 26 37 35 20 20 20 20 20 20 20 20 20 20 5c |B &75 \| 00003d20 20 69 6e 69 74 20 38 32 37 31 20 63 6f 6d 6d 61 | init 8271 comma| 00003d30 6e 64 0d 20 20 20 20 20 20 20 20 45 51 55 42 20 |nd. EQUB | 00003d40 31 32 20 20 20 20 20 20 20 20 20 20 20 5c 20 32 |12 \ 2| 00003d50 34 20 6d 69 6c 6c 69 73 65 63 6f 6e 64 73 20 73 |4 milliseconds s| 00003d60 74 65 70 20 74 69 6d 65 0d 20 20 20 20 20 20 20 |tep time. | 00003d70 20 45 51 55 42 20 31 30 20 20 20 20 20 20 20 20 | EQUB 10 | 00003d80 20 20 20 5c 20 32 30 20 6d 69 6c 6c 69 73 65 63 | \ 20 millisec| 00003d90 6f 6e 64 73 20 73 65 74 74 6c 65 20 74 69 6d 65 |onds settle time| 00003da0 0d 20 20 20 20 20 20 20 20 45 51 55 42 20 26 43 |. EQUB &C| 00003db0 38 20 20 20 20 20 20 20 20 20 20 5c 20 55 6e 6c |8 \ Unl| 00003dc0 6f 61 64 20 3d 20 31 32 20 72 65 76 73 2c 20 6c |oad = 12 revs, l| 00003dd0 6f 61 64 20 3d 36 34 20 6d 69 6c 6c 69 73 65 63 |oad =64 millisec| 00003de0 6f 6e 64 73 0d 20 20 20 20 20 20 20 20 45 51 55 |onds. EQU| 00003df0 42 20 26 30 30 20 20 20 20 20 20 20 20 20 20 5c |B &00 \| 00003e00 20 72 65 73 75 6c 74 20 62 79 74 65 0d 0d 0d 2d | result byte...-| 00003e10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 4f |--------------.O| 00003e20 73 77 6f 72 64 20 26 37 46 20 53 65 65 6b 0d 2d |sword &7F Seek.-| 00003e30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d |--------------..| 00003e40 54 68 65 20 4f 73 77 6f 72 64 20 26 37 46 20 53 |The Osword &7F S| 00003e50 65 65 6b 20 63 6f 6d 6d 61 6e 64 20 75 73 65 73 |eek command uses| 00003e60 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 | the appropriate| 00003e70 20 74 72 61 63 6b 20 72 65 67 69 73 74 65 72 20 | track register | 00003e80 61 73 20 61 20 62 61 73 65 0d 66 72 6f 6d 20 77 |as a base.from w| 00003e90 68 69 63 68 20 74 6f 20 73 65 65 6b 20 61 20 73 |hich to seek a s| 00003ea0 70 65 63 69 66 69 65 64 20 70 68 79 73 69 63 61 |pecified physica| 00003eb0 6c 20 74 72 61 63 6b 2e 20 52 65 67 69 73 74 65 |l track. Registe| 00003ec0 72 20 6e 75 6d 62 65 72 20 26 31 32 20 69 73 20 |r number &12 is | 00003ed0 75 73 65 64 0d 66 6f 72 20 64 72 69 76 65 20 30 |used.for drive 0| 00003ee0 2f 32 20 61 6e 64 20 72 65 67 69 73 74 65 72 20 |/2 and register | 00003ef0 6e 75 6d 62 65 72 20 26 31 41 20 69 73 20 75 73 |number &1A is us| 00003f00 65 64 20 66 6f 72 20 64 72 69 76 65 20 31 2f 33 |ed for drive 1/3| 00003f10 2e 20 54 68 69 73 20 63 6f 6d 6d 61 6e 64 0d 64 |. This command.d| 00003f20 6f 65 73 20 6e 6f 74 20 6c 6f 61 64 20 74 68 65 |oes not load the| 00003f30 20 68 65 61 64 20 61 6e 64 20 64 6f 65 73 20 6e | head and does n| 00003f40 6f 74 20 63 68 65 63 6b 20 74 68 65 20 73 65 63 |ot check the sec| 00003f50 74 6f 72 20 49 44 73 2e 20 49 66 20 74 72 61 63 |tor IDs. If trac| 00003f60 6b 20 30 20 69 73 0d 73 70 65 63 69 66 69 65 64 |k 0 is.specified| 00003f70 20 74 68 65 20 73 65 65 6b 20 63 6f 6d 6d 61 6e | the seek comman| 00003f80 64 20 73 74 65 70 73 20 74 68 65 20 68 65 61 64 |d steps the head| 00003f90 20 6f 75 74 77 61 72 64 73 20 75 6e 74 69 6c 20 | outwards until | 00003fa0 69 74 20 74 72 69 70 73 20 74 68 65 0d 74 72 61 |it trips the.tra| 00003fb0 63 6b 20 30 20 73 77 69 74 63 68 2e 20 49 66 20 |ck 0 switch. If | 00003fc0 74 68 65 20 54 52 4b 30 20 73 69 67 6e 61 6c 20 |the TRK0 signal | 00003fd0 69 73 20 6d 69 73 73 69 6e 67 20 61 66 74 65 72 |is missing after| 00003fe0 20 32 35 35 20 61 74 74 65 6d 70 74 73 20 74 6f | 255 attempts to| 00003ff0 20 66 69 6e 64 0d 69 74 2c 20 74 68 65 20 63 6f | find.it, the co| 00004000 6d 6d 61 6e 64 20 72 65 70 6f 72 74 73 20 65 72 |mmand reports er| 00004010 72 6f 72 20 26 31 34 20 69 6e 20 74 68 65 20 72 |ror &14 in the r| 00004020 65 73 75 6c 74 20 62 79 74 65 2e 20 45 72 72 6f |esult byte. Erro| 00004030 72 20 26 31 34 20 69 73 0d 70 68 79 73 69 63 61 |r &14 is.physica| 00004040 6c 20 74 72 61 63 6b 20 7a 65 72 6f 20 6e 6f 74 |l track zero not| 00004050 20 66 6f 75 6e 64 20 28 73 65 65 20 66 69 67 75 | found (see figu| 00004060 72 65 20 32 29 2e 0d 0d 53 65 65 6b 20 74 72 61 |re 2)...Seek tra| 00004070 63 6b 20 30 20 63 61 6e 20 62 65 20 75 73 65 64 |ck 0 can be used| 00004080 20 74 6f 20 66 69 6e 64 20 61 20 62 61 73 65 20 | to find a base | 00004090 66 72 6f 6d 20 77 68 69 63 68 20 74 6f 20 73 65 |from which to se| 000040a0 65 6b 20 61 6e 79 20 6f 74 68 65 72 0d 70 68 79 |ek any other.phy| 000040b0 73 69 63 61 6c 20 74 72 61 63 6b 2e 20 54 68 69 |sical track. Thi| 000040c0 73 20 63 61 6e 20 62 65 20 75 73 65 66 75 6c 20 |s can be useful | 000040d0 69 66 20 74 68 65 20 74 72 61 63 6b 20 72 65 67 |if the track reg| 000040e0 69 73 74 65 72 20 63 6f 6e 74 61 69 6e 73 20 61 |ister contains a| 000040f0 6e 0d 75 6e 6b 6e 6f 77 6e 20 6f 72 20 69 6e 63 |n.unknown or inc| 00004100 6f 72 72 65 63 74 20 70 68 79 73 69 63 61 6c 20 |orrect physical | 00004110 74 72 61 63 6b 20 6e 75 6d 62 65 72 2e 0d 0d 54 |track number...T| 00004120 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61 72 |he following par| 00004130 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 69 73 20 |ameter block is | 00004140 75 73 65 64 20 74 6f 20 73 65 65 6b 20 61 20 70 |used to seek a p| 00004150 68 79 73 69 63 61 6c 20 74 72 61 63 6b 2e 0d 0d |hysical track...| 00004160 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 |Parameter block | 00004170 26 30 30 20 20 20 20 20 20 20 3d 20 64 72 69 76 |&00 = driv| 00004180 65 20 6e 75 6d 62 65 72 20 28 26 30 30 2d 26 30 |e number (&00-&0| 00004190 33 20 6f 72 20 26 46 46 29 0d 50 61 72 61 6d 65 |3 or &FF).Parame| 000041a0 74 65 72 20 62 6c 6f 63 6b 20 26 30 31 20 2d 20 |ter block &01 - | 000041b0 26 30 34 20 3d 20 62 75 66 66 65 72 20 61 64 64 |&04 = buffer add| 000041c0 72 65 73 73 20 28 6e 6f 74 20 75 73 65 64 29 0d |ress (not used).| 000041d0 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 |Parameter block | 000041e0 26 30 35 20 20 20 20 20 20 20 3d 20 26 30 31 20 |&05 = &01 | 000041f0 28 31 20 63 6f 6d 6d 61 6e 64 20 70 61 72 61 6d |(1 command param| 00004200 65 74 65 72 29 0d 50 61 72 61 6d 65 74 65 72 20 |eter).Parameter | 00004210 62 6c 6f 63 6b 20 26 30 36 20 20 20 20 20 20 20 |block &06 | 00004220 3d 20 26 36 39 20 28 73 65 65 6b 20 63 6f 6d 6d |= &69 (seek comm| 00004230 61 6e 64 29 0d 50 61 72 61 6d 65 74 65 72 20 62 |and).Parameter b| 00004240 6c 6f 63 6b 20 26 30 37 20 20 20 20 20 20 20 3d |lock &07 =| 00004250 20 70 68 79 73 69 63 61 6c 20 74 72 61 63 6b 20 | physical track | 00004260 6e 75 6d 62 65 72 0d 50 61 72 61 6d 65 74 65 72 |number.Parameter| 00004270 20 62 6c 6f 63 6b 20 26 30 38 20 20 20 20 20 20 | block &08 | 00004280 20 3d 20 72 65 73 75 6c 74 20 62 79 74 65 0d 0d | = result byte..| 00004290 0d 54 68 65 20 4f 73 77 6f 72 64 20 26 37 46 20 |.The Osword &7F | 000042a0 53 65 65 6b 20 63 6f 6d 6d 61 6e 64 20 69 73 20 |Seek command is | 000042b0 75 73 65 66 75 6c 20 69 66 2c 20 66 6f 72 20 65 |useful if, for e| 000042c0 78 61 6d 70 6c 65 2c 20 79 6f 75 20 77 61 6e 74 |xample, you want| 000042d0 20 74 6f 20 77 72 69 74 65 0d 64 61 74 61 20 6f | to write.data o| 000042e0 6e 74 6f 20 61 20 63 6f 70 79 2d 70 72 6f 74 65 |nto a copy-prote| 000042f0 63 74 65 64 20 64 69 73 63 20 77 68 69 63 68 20 |cted disc which | 00004300 75 73 65 73 20 64 69 66 66 65 72 65 6e 74 20 70 |uses different p| 00004310 68 79 73 69 63 61 6c 20 61 6e 64 20 6c 6f 67 69 |hysical and logi| 00004320 63 61 6c 0d 74 72 61 63 6b 20 6e 75 6d 62 65 72 |cal.track number| 00004330 73 2e 20 59 6f 75 20 77 6f 75 6c 64 20 75 73 65 |s. You would use| 00004340 20 69 74 20 74 6f 20 73 65 65 6b 20 74 68 65 20 | it to seek the | 00004350 70 68 79 73 69 63 61 6c 20 74 72 61 63 6b 20 6e |physical track n| 00004360 75 6d 62 65 72 20 61 6e 64 20 74 68 65 6e 0d 75 |umber and then.u| 00004370 73 65 20 74 68 65 20 4f 73 77 6f 72 64 20 26 37 |se the Osword &7| 00004380 46 20 57 72 69 74 65 20 53 70 65 63 69 61 6c 20 |F Write Special | 00004390 52 65 67 69 73 74 65 72 20 63 6f 6d 6d 61 6e 64 |Register command| 000043a0 20 74 6f 20 77 72 69 74 65 20 74 68 65 20 6c 6f | to write the lo| 000043b0 67 69 63 61 6c 0d 74 72 61 63 6b 20 6e 75 6d 62 |gical.track numb| 000043c0 65 72 20 69 6e 74 6f 20 74 68 65 20 61 70 70 72 |er into the appr| 000043d0 6f 70 72 69 61 74 65 20 74 72 61 63 6b 20 72 65 |opriate track re| 000043e0 67 69 73 74 65 72 2e 20 41 66 74 65 72 20 77 72 |gister. After wr| 000043f0 69 74 69 6e 67 20 74 6f 20 74 68 65 0d 64 69 73 |iting to the.dis| 00004400 63 20 79 6f 75 20 73 68 6f 75 6c 64 20 74 68 65 |c you should the| 00004410 6e 20 65 69 74 68 65 72 20 72 65 77 72 69 74 65 |n either rewrite| 00004420 20 74 68 65 20 70 68 79 73 69 63 61 6c 20 74 72 | the physical tr| 00004430 61 63 6b 20 6e 75 6d 62 65 72 20 69 6e 74 6f 20 |ack number into | 00004440 74 68 65 0d 61 70 70 72 6f 70 72 69 61 74 65 20 |the.appropriate | 00004450 74 72 61 63 6b 20 72 65 67 69 73 74 65 72 20 6f |track register o| 00004460 72 20 73 65 65 6b 20 74 72 61 63 6b 20 30 2e 0d |r seek track 0..| 00004470 0d 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 |.The following c| 00004480 6f 64 65 20 63 6f 75 6c 64 20 62 65 20 75 73 65 |ode could be use| 00004490 64 20 74 6f 20 73 65 65 6b 20 74 72 61 63 6b 20 |d to seek track | 000044a0 30 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 |0 on the current| 000044b0 20 64 72 69 76 65 2e 0d 0d 0d 20 20 20 20 20 20 | drive.... | 000044c0 20 20 4c 44 41 20 23 26 37 46 0d 20 20 20 20 20 | LDA #&7F. | 000044d0 20 20 20 4c 44 58 20 23 62 6c 6f 63 6b 20 4d 4f | LDX #block MO| 000044e0 44 20 32 35 36 0d 20 20 20 20 20 20 20 20 4c 44 |D 256. LD| 000044f0 59 20 23 62 6c 6f 63 6b 20 44 49 56 20 32 35 36 |Y #block DIV 256| 00004500 0d 20 20 20 20 20 20 20 20 4a 53 52 20 26 46 46 |. JSR &FF| 00004510 46 31 0d 20 20 20 20 20 20 20 20 52 54 53 0d 2e |F1. RTS..| 00004520 62 6c 6f 63 6b 0d 20 20 20 20 20 20 20 20 45 51 |block. EQ| 00004530 55 42 20 26 46 46 20 20 20 20 20 20 20 20 20 20 |UB &FF | 00004540 5c 20 63 75 72 72 65 6e 74 20 64 72 69 76 65 0d |\ current drive.| 00004550 20 20 20 20 20 20 20 20 45 51 55 44 20 26 30 30 | EQUD &00| 00004560 20 20 20 20 20 20 20 20 20 20 5c 20 62 75 66 66 | \ buff| 00004570 65 72 20 61 64 64 72 65 73 73 20 28 6e 6f 74 20 |er address (not | 00004580 75 73 65 64 29 0d 20 20 20 20 20 20 20 20 45 51 |used). EQ| 00004590 55 42 20 26 30 31 20 20 20 20 20 20 20 20 20 20 |UB &01 | 000045a0 5c 20 31 20 70 61 72 61 6d 65 74 65 72 0d 20 20 |\ 1 parameter. | 000045b0 20 20 20 20 20 20 45 51 55 42 20 26 36 39 20 20 | EQUB &69 | 000045c0 20 20 20 20 20 20 20 20 5c 20 73 65 65 6b 20 63 | \ seek c| 000045d0 6f 6d 6d 61 6e 64 0d 20 20 20 20 20 20 20 20 45 |ommand. E| 000045e0 51 55 42 20 26 30 30 20 20 20 20 20 20 20 20 20 |QUB &00 | 000045f0 20 5c 20 74 72 61 63 6b 20 30 0d 20 20 20 20 20 | \ track 0. | 00004600 20 20 20 45 51 55 42 20 26 30 30 20 20 20 20 20 | EQUB &00 | 00004610 20 20 20 20 20 5c 20 72 65 73 75 6c 74 20 62 79 | \ result by| 00004620 74 65 0d 0d 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |te...-----------| 00004630 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d |---------------.| 00004640 4f 73 77 6f 72 64 20 26 37 46 20 4c 6f 61 64 20 |Osword &7F Load | 00004650 42 61 64 20 54 72 61 63 6b 73 0d 2d 2d 2d 2d 2d |Bad Tracks.-----| 00004660 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00004670 2d 2d 2d 2d 2d 0d 0d 54 68 69 73 20 63 6f 6d 6d |-----..This comm| 00004680 61 6e 64 20 69 73 20 75 73 65 64 20 74 6f 20 74 |and is used to t| 00004690 65 6c 6c 20 74 68 65 20 38 32 37 31 20 74 68 61 |ell the 8271 tha| 000046a0 74 20 74 68 65 72 65 20 61 72 65 20 6f 6e 65 20 |t there are one | 000046b0 6f 72 20 74 77 6f 20 22 62 61 64 0d 74 72 61 63 |or two "bad.trac| 000046c0 6b 73 22 20 6f 6e 20 61 20 64 69 73 63 2e 20 54 |ks" on a disc. T| 000046d0 68 69 73 20 63 6f 6d 6d 61 6e 64 20 69 73 20 6e |his command is n| 000046e0 6f 74 20 66 75 6c 6c 79 20 69 6d 70 6c 65 6d 65 |ot fully impleme| 000046f0 6e 74 65 64 20 69 6e 20 74 68 65 20 31 37 37 30 |nted in the 1770| 00004700 20 64 69 73 63 0d 69 6e 74 65 72 66 61 63 65 20 | disc.interface | 00004710 61 6e 64 20 69 73 20 6e 6f 74 20 75 73 65 64 20 |and is not used | 00004720 62 79 20 65 69 74 68 65 72 20 44 46 53 2e 20 42 |by either DFS. B| 00004730 65 63 61 75 73 65 20 69 74 20 69 73 20 6e 6f 74 |ecause it is not| 00004740 20 75 73 65 64 20 62 79 20 74 68 65 20 44 46 53 | used by the DFS| 00004750 0d 69 74 20 63 61 6e 20 62 65 20 75 73 65 64 20 |.it can be used | 00004760 66 6f 72 20 63 6f 70 79 2d 70 72 6f 74 65 63 74 |for copy-protect| 00004770 69 6e 67 20 64 69 73 63 73 20 77 68 65 6e 20 74 |ing discs when t| 00004780 68 65 20 44 46 53 20 2a 42 41 43 4b 55 50 20 63 |he DFS *BACKUP c| 00004790 6f 6d 6d 61 6e 64 20 77 69 6c 6c 0d 67 69 76 65 |ommand will.give| 000047a0 20 74 68 65 20 22 64 69 73 63 20 66 61 75 6c 74 | the "disc fault| 000047b0 22 20 65 72 72 6f 72 2e 20 43 6f 70 79 2d 70 72 |" error. Copy-pr| 000047c0 6f 74 65 63 74 69 6f 6e 20 77 69 6c 6c 20 62 65 |otection will be| 000047d0 20 63 6f 76 65 72 65 64 20 69 6e 20 64 65 74 61 | covered in deta| 000047e0 69 6c 20 69 6e 0d 6d 6f 64 75 6c 65 20 36 2e 0d |il in.module 6..| 000047f0 0d 54 77 6f 20 62 61 64 20 74 72 61 63 6b 20 72 |.Two bad track r| 00004800 65 67 69 73 74 65 72 73 20 61 72 65 20 61 76 61 |egisters are ava| 00004810 69 6c 61 62 6c 65 20 66 6f 72 20 65 61 63 68 20 |ilable for each | 00004820 64 69 73 63 20 73 75 72 66 61 63 65 20 61 6e 64 |disc surface and| 00004830 20 74 68 65 79 20 61 72 65 0d 75 73 65 64 20 74 | they are.used t| 00004840 6f 20 73 70 65 63 69 66 79 20 77 68 69 63 68 20 |o specify which | 00004850 74 72 61 63 6b 73 20 61 72 65 20 74 6f 20 62 65 |tracks are to be| 00004860 20 74 6f 74 61 6c 6c 79 20 69 67 6e 6f 72 65 64 | totally ignored| 00004870 20 62 79 20 74 68 65 20 38 32 37 31 2e 20 46 6f | by the 8271. Fo| 00004880 72 0d 65 78 61 6d 70 6c 65 2c 20 69 66 20 74 72 |r.example, if tr| 00004890 61 63 6b 20 31 20 69 73 20 62 61 64 20 74 68 65 |ack 1 is bad the| 000048a0 20 38 32 37 31 20 77 69 6c 6c 20 75 73 65 20 74 | 8271 will use t| 000048b0 72 61 63 6b 20 33 20 77 68 65 6e 20 74 72 61 63 |rack 3 when trac| 000048c0 6b 20 32 20 69 73 0d 73 70 65 63 69 66 69 65 64 |k 2 is.specified| 000048d0 2e 20 41 73 20 66 61 72 20 61 73 20 74 68 65 20 |. As far as the | 000048e0 64 69 73 63 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 |disc controller | 000048f0 69 73 20 63 6f 6e 63 65 72 6e 65 64 20 70 68 79 |is concerned phy| 00004900 73 69 63 61 6c 20 74 72 61 63 6b 20 33 20 69 73 |sical track 3 is| 00004910 0d 73 65 65 6e 20 61 73 20 70 68 79 73 69 63 61 |.seen as physica| 00004920 6c 20 74 72 61 63 6b 20 32 2c 20 70 68 79 73 69 |l track 2, physi| 00004930 63 61 6c 20 74 72 61 63 6b 20 34 20 69 73 20 73 |cal track 4 is s| 00004940 65 65 6e 20 61 73 20 70 68 79 73 69 63 61 6c 20 |een as physical | 00004950 74 72 61 63 6b 20 33 2c 0d 61 6e 64 20 73 6f 20 |track 3,.and so | 00004960 6f 6e 2e 0d 0d 57 68 65 6e 20 62 61 64 20 74 72 |on...When bad tr| 00004970 61 63 6b 73 20 61 72 65 20 75 73 65 64 20 74 68 |acks are used th| 00004980 65 69 72 20 74 72 61 63 6b 20 6e 75 6d 62 65 72 |eir track number| 00004990 20 49 44 73 20 73 68 6f 75 6c 64 20 62 65 20 73 | IDs should be s| 000049a0 65 74 20 74 6f 20 26 46 46 20 77 68 65 6e 0d 74 |et to &FF when.t| 000049b0 68 65 20 64 69 73 63 20 69 73 20 66 6f 72 6d 61 |he disc is forma| 000049c0 74 74 65 64 2e 20 54 72 61 63 6b 20 30 20 6d 75 |tted. Track 0 mu| 000049d0 73 74 20 6e 6f 74 20 62 65 20 73 65 74 20 61 73 |st not be set as| 000049e0 20 61 20 62 61 64 20 74 72 61 63 6b 2e 20 54 68 | a bad track. Th| 000049f0 65 20 63 6f 6d 6d 61 6e 64 0d 6c 61 73 74 73 20 |e command.lasts | 00004a00 75 6e 74 69 6c 20 61 20 68 61 72 64 20 72 65 73 |until a hard res| 00004a10 65 74 2e 0d 0d 54 68 65 20 66 6f 6c 6c 6f 77 69 |et...The followi| 00004a20 6e 67 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f |ng parameter blo| 00004a30 63 6b 20 69 73 20 75 73 65 64 20 62 79 20 4f 73 |ck is used by Os| 00004a40 77 6f 72 64 20 26 37 46 20 4c 6f 61 64 20 42 61 |word &7F Load Ba| 00004a50 64 20 54 72 61 63 6b 73 2e 0d 0d 50 61 72 61 6d |d Tracks...Param| 00004a60 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 30 20 20 |eter block &00 | 00004a70 20 20 20 20 20 3d 20 64 72 69 76 65 20 6e 75 6d | = drive num| 00004a80 62 65 72 20 28 26 30 30 2d 26 30 33 20 6f 72 20 |ber (&00-&03 or | 00004a90 26 46 46 29 0d 50 61 72 61 6d 65 74 65 72 20 62 |&FF).Parameter b| 00004aa0 6c 6f 63 6b 20 26 30 31 20 2d 20 26 30 34 20 3d |lock &01 - &04 =| 00004ab0 20 62 75 66 66 65 72 20 61 64 64 72 65 73 73 20 | buffer address | 00004ac0 28 6e 6f 74 20 75 73 65 64 29 0d 50 61 72 61 6d |(not used).Param| 00004ad0 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 35 20 20 |eter block &05 | 00004ae0 20 20 20 20 20 3d 20 26 30 34 20 28 34 20 63 6f | = &04 (4 co| 00004af0 6d 6d 61 6e 64 20 70 61 72 61 6d 65 74 65 72 73 |mmand parameters| 00004b00 29 0d 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 |).Parameter bloc| 00004b10 6b 20 26 30 36 20 20 20 20 20 20 20 3d 20 26 37 |k &06 = &7| 00004b20 35 20 28 6c 6f 61 64 20 62 61 64 20 74 72 61 63 |5 (load bad trac| 00004b30 6b 73 20 63 6f 6d 6d 61 6e 64 29 0d 50 61 72 61 |ks command).Para| 00004b40 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 37 20 |meter block &07 | 00004b50 20 20 20 20 20 20 3d 20 64 72 69 76 65 20 70 61 | = drive pa| 00004b60 69 72 20 28 26 31 30 20 3d 20 64 72 69 76 65 20 |ir (&10 = drive | 00004b70 30 2f 32 2c 20 26 31 38 20 3d 20 64 72 69 76 65 |0/2, &18 = drive| 00004b80 20 31 2f 33 29 0d 50 61 72 61 6d 65 74 65 72 20 | 1/3).Parameter | 00004b90 62 6c 6f 63 6b 20 26 30 38 20 20 20 20 20 20 20 |block &08 | 00004ba0 3d 20 62 61 64 20 74 72 61 63 6b 20 6e 75 6d 62 |= bad track numb| 00004bb0 65 72 20 31 0d 50 61 72 61 6d 65 74 65 72 20 62 |er 1.Parameter b| 00004bc0 6c 6f 63 6b 20 26 30 39 20 20 20 20 20 20 20 3d |lock &09 =| 00004bd0 20 62 61 64 20 74 72 61 63 6b 20 6e 75 6d 62 65 | bad track numbe| 00004be0 72 20 32 0d 50 61 72 61 6d 65 74 65 72 20 62 6c |r 2.Parameter bl| 00004bf0 6f 63 6b 20 26 30 41 20 20 20 20 20 20 20 3d 20 |ock &0A = | 00004c00 63 75 72 72 65 6e 74 20 70 68 79 73 69 63 61 6c |current physical| 00004c10 20 74 72 61 63 6b 0d 50 61 72 61 6d 65 74 65 72 | track.Parameter| 00004c20 20 62 6c 6f 63 6b 20 26 30 42 20 20 20 20 20 20 | block &0B | 00004c30 20 3d 20 72 65 73 75 6c 74 20 62 79 74 65 0d 0d | = result byte..| 00004c40 0d 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 |.The following c| 00004c50 6f 64 65 20 63 6f 75 6c 64 20 62 65 20 75 73 65 |ode could be use| 00004c60 64 20 74 6f 20 6c 6f 61 64 20 62 61 64 20 74 72 |d to load bad tr| 00004c70 61 63 6b 73 20 31 20 61 6e 64 20 32 2e 20 4f 73 |acks 1 and 2. Os| 00004c80 77 6f 72 64 20 26 37 46 0d 53 65 65 6b 20 63 6f |word &7F.Seek co| 00004c90 6d 6d 61 6e 64 20 69 73 20 75 73 65 64 20 74 6f |mmand is used to| 00004ca0 20 70 6f 73 69 74 69 6f 6e 20 74 68 65 20 68 65 | position the he| 00004cb0 61 64 20 6f 76 65 72 20 61 20 6b 6e 6f 77 6e 20 |ad over a known | 00004cc0 70 68 79 73 69 63 61 6c 20 74 72 61 63 6b 2c 20 |physical track, | 00004cd0 69 6e 0d 74 68 69 73 20 63 61 73 65 20 74 72 61 |in.this case tra| 00004ce0 63 6b 20 7a 65 72 6f 2e 0d 0d 0d 20 20 20 20 20 |ck zero.... | 00004cf0 20 20 20 4a 53 52 20 73 65 65 6b 7a 65 72 6f 20 | JSR seekzero | 00004d00 20 20 20 20 20 5c 20 73 65 65 6b 20 74 72 61 63 | \ seek trac| 00004d10 6b 20 7a 65 72 6f 0d 20 20 20 20 20 20 20 20 4c |k zero. L| 00004d20 44 41 20 23 26 37 46 0d 20 20 20 20 20 20 20 20 |DA #&7F. | 00004d30 4c 44 58 20 23 62 6c 6f 63 6b 20 4d 4f 44 20 32 |LDX #block MOD 2| 00004d40 35 36 0d 20 20 20 20 20 20 20 20 4c 44 59 20 23 |56. LDY #| 00004d50 62 6c 6f 63 6b 20 44 49 56 20 32 35 36 0d 20 20 |block DIV 256. | 00004d60 20 20 20 20 20 20 4a 53 52 20 26 46 46 46 31 0d | JSR &FFF1.| 00004d70 20 20 20 20 20 20 20 20 52 54 53 0d 2e 62 6c 6f | RTS..blo| 00004d80 63 6b 0d 20 20 20 20 20 20 20 20 45 51 55 42 20 |ck. EQUB | 00004d90 26 30 30 20 20 20 20 20 20 20 20 20 20 5c 20 64 |&00 \ d| 00004da0 72 69 76 65 20 30 0d 20 20 20 20 20 20 20 20 45 |rive 0. E| 00004db0 51 55 44 20 26 30 30 20 20 20 20 20 20 20 20 20 |QUD &00 | 00004dc0 20 5c 20 62 75 66 66 65 72 20 61 64 64 72 65 73 | \ buffer addres| 00004dd0 73 20 28 6e 6f 74 20 75 73 65 64 29 0d 20 20 20 |s (not used). | 00004de0 20 20 20 20 20 45 51 55 42 20 26 30 34 20 20 20 | EQUB &04 | 00004df0 20 20 20 20 20 20 20 5c 20 34 20 70 61 72 61 6d | \ 4 param| 00004e00 65 74 65 72 73 0d 20 20 20 20 20 20 20 20 45 51 |eters. EQ| 00004e10 55 42 20 26 37 35 20 20 20 20 20 20 20 20 20 20 |UB &75 | 00004e20 5c 20 6c 6f 61 64 20 62 61 64 20 74 72 61 63 6b |\ load bad track| 00004e30 73 20 63 6f 6d 6d 61 6e 64 0d 20 20 20 20 20 20 |s command. | 00004e40 20 20 45 51 55 42 20 26 31 30 20 20 20 20 20 20 | EQUB &10 | 00004e50 20 20 20 20 5c 20 64 72 69 76 65 20 30 2f 32 0d | \ drive 0/2.| 00004e60 20 20 20 20 20 20 20 20 45 51 55 42 20 26 30 31 | EQUB &01| 00004e70 20 20 20 20 20 20 20 20 20 20 5c 20 74 72 61 63 | \ trac| 00004e80 6b 20 31 0d 20 20 20 20 20 20 20 20 45 51 55 42 |k 1. EQUB| 00004e90 20 26 30 32 20 20 20 20 20 20 20 20 20 20 5c 20 | &02 \ | 00004ea0 74 72 61 63 6b 20 32 0d 20 20 20 20 20 20 20 20 |track 2. | 00004eb0 45 51 55 42 20 26 30 30 20 20 20 20 20 20 20 20 |EQUB &00 | 00004ec0 20 20 5c 20 63 75 72 72 65 6e 74 20 74 72 61 63 | \ current trac| 00004ed0 6b 0d 20 20 20 20 20 20 20 20 45 51 55 42 20 26 |k. EQUB &| 00004ee0 30 30 20 20 20 20 20 20 20 20 20 20 5c 20 72 65 |00 \ re| 00004ef0 73 75 6c 74 20 62 79 74 65 0d 0d 0d 2d 2d 2d 2d |sult byte...----| 00004f00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00004f10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 4f 73 |-------------.Os| 00004f20 77 6f 72 64 20 26 37 46 20 57 72 69 74 65 20 53 |word &7F Write S| 00004f30 70 65 63 69 61 6c 20 52 65 67 69 73 74 65 72 0d |pecial Register.| 00004f40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00004f60 2d 0d 0d 54 68 65 20 69 6e 74 65 72 6e 61 6c 20 |-..The internal | 00004f70 72 65 67 69 73 74 65 72 73 20 6f 66 20 74 68 65 |registers of the| 00004f80 20 38 32 37 31 20 63 61 6e 20 62 65 20 6f 76 65 | 8271 can be ove| 00004f90 72 77 72 69 74 74 65 6e 20 75 73 69 6e 67 20 74 |rwritten using t| 00004fa0 68 65 20 4f 73 77 6f 72 64 20 26 37 46 0d 57 72 |he Osword &7F.Wr| 00004fb0 69 74 65 20 53 70 65 63 69 61 6c 20 52 65 67 69 |ite Special Regi| 00004fc0 73 74 65 72 20 63 6f 6d 6d 61 6e 64 2e 20 54 68 |ster command. Th| 00004fd0 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 61 6c |e contents of al| 00004fe0 6c 20 74 68 65 20 72 65 67 69 73 74 65 72 73 20 |l the registers | 00004ff0 69 6e 0d 66 69 67 75 72 65 20 34 20 63 61 6e 20 |in.figure 4 can | 00005000 62 65 20 61 6c 74 65 72 65 64 20 62 75 74 20 79 |be altered but y| 00005010 6f 75 20 61 72 65 20 61 64 76 69 73 65 64 20 74 |ou are advised t| 00005020 6f 20 6c 69 6d 69 74 20 79 6f 75 72 73 65 6c 66 |o limit yourself| 00005030 20 74 6f 20 61 6c 74 65 72 69 6e 67 0d 74 68 65 | to altering.the| 00005040 20 74 72 61 63 6b 20 72 65 67 69 73 74 65 72 73 | track registers| 00005050 2c 20 6e 75 6d 62 65 72 73 20 26 31 32 20 61 6e |, numbers &12 an| 00005060 64 20 26 31 41 2e 20 54 68 65 20 62 61 64 20 74 |d &1A. The bad t| 00005070 72 61 63 6b 20 72 65 67 69 73 74 65 72 73 20 68 |rack registers h| 00005080 61 76 65 0d 74 68 65 69 72 20 6f 77 6e 20 4f 73 |ave.their own Os| 00005090 77 6f 72 64 20 26 37 46 20 4c 6f 61 64 20 42 61 |word &7F Load Ba| 000050a0 64 20 54 72 61 63 6b 73 20 63 6f 6d 6d 61 6e 64 |d Tracks command| 000050b0 20 64 65 73 63 72 69 62 65 64 20 61 62 6f 76 65 | described above| 000050c0 20 62 75 74 20 74 68 65 79 20 63 61 6e 0d 61 6c | but they can.al| 000050d0 73 6f 20 62 65 20 61 6c 74 65 72 65 64 20 77 69 |so be altered wi| 000050e0 74 68 20 74 68 65 20 4f 73 77 6f 72 64 20 26 37 |th the Osword &7| 000050f0 46 20 57 72 69 74 65 20 53 70 65 63 69 61 6c 20 |F Write Special | 00005100 52 65 67 69 73 74 65 72 20 63 6f 6d 6d 61 6e 64 |Register command| 00005110 2e 20 49 66 20 79 6f 75 0d 64 65 63 69 64 65 20 |. If you.decide | 00005120 74 6f 20 61 6c 74 65 72 20 61 6e 79 20 6f 74 68 |to alter any oth| 00005130 65 72 20 72 65 67 69 73 74 65 72 73 20 74 68 65 |er registers the| 00005140 20 72 65 73 75 6c 74 73 20 61 72 65 20 6c 69 6b | results are lik| 00005150 65 6c 79 20 74 6f 20 62 65 0d 64 69 73 61 73 74 |ely to be.disast| 00005160 65 72 6f 75 73 20 2d 20 79 6f 75 20 68 61 76 65 |erous - you have| 00005170 20 62 65 65 6e 20 77 61 72 6e 65 64 21 0d 0d 0d | been warned!...| 00005180 20 20 20 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d | +-------| 00005190 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d 2d |-------+--------| 000051a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000051b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 20 20 20 20 20 |---------+. | 000051c0 20 20 20 7c 20 52 65 67 69 73 74 65 72 20 6e 6f | | Register no| 000051d0 2e 20 7c 20 52 65 67 69 73 74 65 72 20 20 20 20 |. | Register | 000051e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000051f0 20 20 20 20 7c 0d 20 20 20 20 20 20 20 20 2b 2d | |. +-| 00005200 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d |-------------+--| 00005210 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00005220 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 00005230 0d 20 20 20 20 20 20 20 20 7c 20 20 20 20 20 26 |. | &| 00005240 30 36 20 20 20 20 20 20 7c 20 53 63 61 6e 20 73 |06 | Scan s| 00005250 65 63 74 6f 72 20 72 65 67 69 73 74 65 72 20 20 |ector register | 00005260 20 20 20 20 20 20 20 20 20 20 7c 0d 20 20 20 20 | |. | 00005270 20 20 20 20 7c 20 20 20 20 20 26 31 30 20 20 20 | | &10 | 00005280 20 20 20 7c 20 42 61 64 20 74 72 61 63 6b 20 72 | | Bad track r| 00005290 65 67 69 73 74 65 72 20 31 2c 20 64 72 69 76 65 |egister 1, drive| 000052a0 20 30 2f 32 20 7c 0d 20 20 20 20 20 20 20 20 7c | 0/2 |. || 000052b0 20 20 20 20 20 26 31 31 20 20 20 20 20 20 7c 20 | &11 | | 000052c0 42 61 64 20 74 72 61 63 6b 20 72 65 67 69 73 74 |Bad track regist| 000052d0 65 72 20 32 2c 20 64 72 69 76 65 20 30 2f 32 20 |er 2, drive 0/2 | 000052e0 7c 0d 20 20 20 20 20 20 20 20 7c 20 20 20 20 20 ||. | | 000052f0 26 31 32 20 20 20 20 20 20 7c 20 54 72 61 63 6b |&12 | Track| 00005300 20 72 65 67 69 73 74 65 72 2c 20 64 72 69 76 65 | register, drive| 00005310 20 30 2f 32 20 20 20 20 20 20 20 7c 0d 20 20 20 | 0/2 |. | 00005320 20 20 20 20 20 7c 20 20 20 20 20 26 31 33 20 20 | | &13 | 00005330 20 20 20 20 7c 20 53 63 61 6e 20 63 6f 75 6e 74 | | Scan count| 00005340 20 72 65 67 69 73 74 65 72 20 28 4c 53 42 29 20 | register (LSB) | 00005350 20 20 20 20 20 20 7c 0d 20 20 20 20 20 20 20 20 | |. | 00005360 7c 20 20 20 20 20 26 31 34 20 20 20 20 20 20 7c || &14 || 00005370 20 53 63 61 6e 20 63 6f 75 6e 74 20 72 65 67 69 | Scan count regi| 00005380 73 74 65 72 20 28 4d 53 42 29 20 20 20 20 20 20 |ster (MSB) | 00005390 20 7c 0d 20 20 20 20 20 20 20 20 7c 20 20 20 20 | |. | | 000053a0 20 26 31 37 20 20 20 20 20 20 7c 20 44 4d 41 20 | &17 | DMA | 000053b0 6d 6f 64 65 20 72 65 67 69 73 74 65 72 20 20 20 |mode register | 000053c0 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 20 20 | |. | 000053d0 20 20 20 20 20 20 7c 20 20 20 20 20 26 31 38 20 | | &18 | 000053e0 20 20 20 20 20 7c 20 42 61 64 20 74 72 61 63 6b | | Bad track| 000053f0 20 72 65 67 69 73 74 65 72 20 31 2c 20 64 72 69 | register 1, dri| 00005400 76 65 20 31 2f 33 20 7c 0d 20 20 20 20 20 20 20 |ve 1/3 |. | 00005410 20 7c 20 20 20 20 20 26 31 39 20 20 20 20 20 20 | | &19 | 00005420 7c 20 42 61 64 20 74 72 61 63 6b 20 72 65 67 69 || Bad track regi| 00005430 73 74 65 72 20 32 2c 20 64 72 69 76 65 20 31 2f |ster 2, drive 1/| 00005440 33 20 7c 0d 20 20 20 20 20 20 20 20 7c 20 20 20 |3 |. | | 00005450 20 20 26 31 41 20 20 20 20 20 20 7c 20 54 72 61 | &1A | Tra| 00005460 63 6b 20 72 65 67 69 73 74 65 72 2c 20 64 72 69 |ck register, dri| 00005470 76 65 20 31 2f 33 20 20 20 20 20 20 20 7c 0d 20 |ve 1/3 |. | 00005480 20 20 20 20 20 20 20 7c 20 20 20 20 20 26 32 32 | | &22| 00005490 20 20 20 20 20 20 7c 20 44 72 69 76 65 20 63 6f | | Drive co| 000054a0 6e 74 72 6f 6c 20 69 6e 70 75 74 20 72 65 67 69 |ntrol input regi| 000054b0 73 74 65 72 20 20 20 20 7c 0d 20 20 20 20 20 20 |ster |. | 000054c0 20 20 7c 20 20 20 20 20 26 32 33 20 20 20 20 20 | | &23 | 000054d0 20 7c 20 44 72 69 76 65 20 63 6f 6e 74 72 6f 6c | | Drive control| 000054e0 20 6f 75 74 70 75 74 20 72 65 67 69 73 74 65 72 | output register| 000054f0 20 20 20 7c 0d 20 20 20 20 20 20 20 20 2b 2d 2d | |. +--| 00005500 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d |------------+---| 00005510 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00005520 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d |--------------+.| 00005530 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00005540 20 46 69 67 75 72 65 20 34 2e 20 54 68 65 20 38 | Figure 4. The 8| 00005550 32 37 31 20 72 65 67 69 73 74 65 72 73 0d 20 20 |271 registers. | 00005560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d | --| 00005570 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00005580 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d 0d 54 68 65 |----------...The| 00005590 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61 72 61 6d | following param| 000055a0 65 74 65 72 20 62 6c 6f 63 6b 20 6d 75 73 74 20 |eter block must | 000055b0 62 65 20 75 73 65 64 20 77 69 74 68 20 74 68 65 |be used with the| 000055c0 20 4f 73 77 6f 72 64 20 26 37 46 20 57 72 69 74 | Osword &7F Writ| 000055d0 65 0d 53 70 65 63 69 61 6c 20 52 65 67 69 73 74 |e.Special Regist| 000055e0 65 72 20 63 6f 6d 6d 61 6e 64 2e 0d 0d 50 61 72 |er command...Par| 000055f0 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 30 |ameter block &00| 00005600 20 20 20 20 20 20 20 3d 20 64 72 69 76 65 20 6e | = drive n| 00005610 75 6d 62 65 72 20 28 26 30 30 2d 26 30 33 20 6f |umber (&00-&03 o| 00005620 72 20 26 46 46 29 0d 50 61 72 61 6d 65 74 65 72 |r &FF).Parameter| 00005630 20 62 6c 6f 63 6b 20 26 30 31 20 2d 20 26 30 34 | block &01 - &04| 00005640 20 3d 20 62 75 66 66 65 72 20 61 64 64 72 65 73 | = buffer addres| 00005650 73 20 28 6e 6f 74 20 75 73 65 64 29 0d 50 61 72 |s (not used).Par| 00005660 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 35 |ameter block &05| 00005670 20 20 20 20 20 20 20 3d 20 26 30 32 20 28 32 20 | = &02 (2 | 00005680 63 6f 6d 6d 61 6e 64 20 70 61 72 61 6d 65 74 65 |command paramete| 00005690 72 73 29 0d 50 61 72 61 6d 65 74 65 72 20 62 6c |rs).Parameter bl| 000056a0 6f 63 6b 20 26 30 36 20 20 20 20 20 20 20 3d 20 |ock &06 = | 000056b0 26 37 41 20 28 77 72 69 74 65 20 73 70 65 63 69 |&7A (write speci| 000056c0 61 6c 20 72 65 67 69 73 74 65 72 20 63 6f 6d 6d |al register comm| 000056d0 61 6e 64 29 0d 50 61 72 61 6d 65 74 65 72 20 62 |and).Parameter b| 000056e0 6c 6f 63 6b 20 26 30 37 20 20 20 20 20 20 20 3d |lock &07 =| 000056f0 20 72 65 67 69 73 74 65 72 20 6e 75 6d 62 65 72 | register number| 00005700 20 28 66 72 6f 6d 20 66 69 67 75 72 65 20 34 29 | (from figure 4)| 00005710 0d 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b |.Parameter block| 00005720 20 26 30 38 20 20 20 20 20 20 20 3d 20 76 61 6c | &08 = val| 00005730 75 65 20 74 6f 20 70 75 74 20 69 6e 20 72 65 67 |ue to put in reg| 00005740 69 73 74 65 72 0d 50 61 72 61 6d 65 74 65 72 20 |ister.Parameter | 00005750 62 6c 6f 63 6b 20 26 30 39 20 20 20 20 20 20 20 |block &09 | 00005760 3d 20 72 65 73 75 6c 74 20 62 79 74 65 0d 0d 0d |= result byte...| 00005770 54 68 65 20 74 72 61 63 6b 20 72 65 67 69 73 74 |The track regist| 00005780 65 72 73 20 26 31 32 20 28 64 72 69 76 65 20 30 |ers &12 (drive 0| 00005790 2f 32 29 20 61 6e 64 20 26 31 41 20 28 64 72 69 |/2) and &1A (dri| 000057a0 76 65 20 31 2f 33 29 20 61 72 65 20 75 73 65 64 |ve 1/3) are used| 000057b0 20 62 79 20 74 68 65 0d 64 69 73 63 20 63 6f 6e | by the.disc con| 000057c0 74 72 6f 6c 6c 65 72 20 74 6f 20 69 64 65 6e 74 |troller to ident| 000057d0 69 66 79 20 69 74 73 20 63 75 72 72 65 6e 74 20 |ify its current | 000057e0 74 72 61 63 6b 20 70 6f 73 69 74 69 6f 6e 2e 20 |track position. | 000057f0 54 68 65 73 65 20 72 65 67 69 73 74 65 72 73 0d |These registers.| 00005800 63 6f 6e 74 61 69 6e 20 74 68 65 20 6e 75 6d 62 |contain the numb| 00005810 65 72 20 6f 66 20 74 68 65 20 70 68 79 73 69 63 |er of the physic| 00005820 61 6c 20 74 72 61 63 6b 2e 20 49 66 20 74 68 65 |al track. If the| 00005830 20 6c 6f 67 69 63 61 6c 20 74 72 61 63 6b 20 6e | logical track n| 00005840 75 6d 62 65 72 0d 73 74 6f 72 65 64 20 69 6e 20 |umber.stored in | 00005850 74 68 65 20 73 65 63 74 6f 72 20 49 44 20 69 73 |the sector ID is| 00005860 20 6e 6f 74 20 74 68 65 20 73 61 6d 65 20 61 73 | not the same as| 00005870 20 74 68 65 20 70 68 79 73 69 63 61 6c 20 74 72 | the physical tr| 00005880 61 63 6b 20 6e 75 6d 62 65 72 20 79 6f 75 0d 73 |ack number you.s| 00005890 68 6f 75 6c 64 20 61 6c 77 61 79 73 20 75 73 65 |hould always use| 000058a0 20 74 68 65 20 77 72 69 74 65 20 73 70 65 63 69 | the write speci| 000058b0 61 6c 20 72 65 67 69 73 74 65 72 20 63 6f 6d 6d |al register comm| 000058c0 61 6e 64 20 74 6f 20 73 74 6f 72 65 20 74 68 65 |and to store the| 000058d0 20 6c 6f 67 69 63 61 6c 0d 74 72 61 63 6b 20 6e | logical.track n| 000058e0 75 6d 62 65 72 20 69 6e 20 74 68 65 20 74 72 61 |umber in the tra| 000058f0 63 6b 20 72 65 67 69 73 74 65 72 20 62 65 66 6f |ck register befo| 00005900 72 65 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f |re attempting to| 00005910 20 72 65 61 64 20 66 72 6f 6d 20 6f 72 20 77 72 | read from or wr| 00005920 69 74 65 0d 74 6f 20 74 68 65 20 64 69 73 63 2e |ite.to the disc.| 00005930 20 59 6f 75 20 6d 75 73 74 20 61 6c 77 61 79 73 | You must always| 00005940 20 72 65 73 65 74 20 74 68 65 20 74 72 61 63 6b | reset the track| 00005950 20 72 65 67 69 73 74 65 72 20 74 6f 20 69 74 73 | register to its| 00005960 20 6f 72 69 67 69 6e 61 6c 0d 76 61 6c 75 65 20 | original.value | 00005970 61 66 74 65 72 20 72 65 61 64 69 6e 67 20 6f 72 |after reading or| 00005980 20 77 72 69 74 69 6e 67 2e 20 41 73 20 79 6f 75 | writing. As you| 00005990 20 68 61 76 65 20 73 65 65 6e 20 69 6e 20 74 68 | have seen in th| 000059a0 65 20 6d 6f 64 75 6c 65 20 30 2c 20 75 73 69 6e |e module 0, usin| 000059b0 67 0d 64 69 66 66 65 72 65 6e 74 20 6c 6f 67 69 |g.different logi| 000059c0 63 61 6c 20 61 6e 64 20 70 68 79 73 69 63 61 6c |cal and physical| 000059d0 20 74 72 61 63 6b 20 6e 75 6d 62 65 72 73 20 69 | track numbers i| 000059e0 73 20 79 65 74 20 61 6e 6f 74 68 65 72 20 74 65 |s yet another te| 000059f0 63 68 6e 69 71 75 65 20 66 6f 72 0d 63 6f 70 79 |chnique for.copy| 00005a00 2d 70 72 6f 74 65 63 74 69 6e 67 20 64 69 73 63 |-protecting disc| 00005a10 73 2e 0d 0d 54 68 65 20 66 6f 6c 6c 6f 77 69 6e |s...The followin| 00005a20 67 20 63 6f 64 65 20 63 6f 75 6c 64 20 62 65 20 |g code could be | 00005a30 75 73 65 64 20 74 6f 20 73 65 65 6b 20 74 72 61 |used to seek tra| 00005a40 63 6b 20 30 20 61 6e 64 20 74 68 65 6e 20 6c 6f |ck 0 and then lo| 00005a50 61 64 20 74 68 65 20 74 72 61 63 6b 0d 72 65 67 |ad the track.reg| 00005a60 69 73 74 65 72 20 66 6f 72 20 64 72 69 76 65 20 |ister for drive | 00005a70 30 2f 32 20 77 69 74 68 20 74 68 65 20 6e 75 6d |0/2 with the num| 00005a80 62 65 72 20 31 2e 20 54 72 61 63 6b 20 7a 65 72 |ber 1. Track zer| 00005a90 6f 20 77 69 6c 6c 20 74 68 65 6e 20 62 65 20 73 |o will then be s| 00005aa0 65 65 6e 20 61 73 0d 70 68 79 73 69 63 61 6c 20 |een as.physical | 00005ab0 74 72 61 63 6b 20 31 2e 0d 0d 0d 20 20 20 20 20 |track 1.... | 00005ac0 20 20 20 4a 53 52 20 73 65 65 6b 7a 65 72 6f 20 | JSR seekzero | 00005ad0 20 20 20 20 20 5c 20 73 65 65 6b 20 74 72 61 63 | \ seek trac| 00005ae0 6b 20 7a 65 72 6f 0d 20 20 20 20 20 20 20 20 4c |k zero. L| 00005af0 44 41 20 23 26 37 46 0d 20 20 20 20 20 20 20 20 |DA #&7F. | 00005b00 4c 44 58 20 23 62 6c 6f 63 6b 20 4d 4f 44 20 32 |LDX #block MOD 2| 00005b10 35 36 0d 20 20 20 20 20 20 20 20 4c 44 59 20 23 |56. LDY #| 00005b20 62 6c 6f 63 6b 20 44 49 56 20 32 35 36 0d 20 20 |block DIV 256. | 00005b30 20 20 20 20 20 20 4a 53 52 20 26 46 46 46 31 0d | JSR &FFF1.| 00005b40 20 20 20 20 20 20 20 20 52 54 53 0d 2e 62 6c 6f | RTS..blo| 00005b50 63 6b 0d 20 20 20 20 20 20 20 20 45 51 55 42 20 |ck. EQUB | 00005b60 26 30 30 20 20 20 20 20 20 20 20 20 20 5c 20 64 |&00 \ d| 00005b70 72 69 76 65 20 30 0d 20 20 20 20 20 20 20 20 45 |rive 0. E| 00005b80 51 55 44 20 26 30 30 20 20 20 20 20 20 20 20 20 |QUD &00 | 00005b90 20 5c 20 62 75 66 66 65 72 20 61 64 64 72 65 73 | \ buffer addres| 00005ba0 73 20 28 6e 6f 74 20 75 73 65 64 29 0d 20 20 20 |s (not used). | 00005bb0 20 20 20 20 20 45 51 55 42 20 26 30 32 20 20 20 | EQUB &02 | 00005bc0 20 20 20 20 20 20 20 5c 20 32 20 70 61 72 61 6d | \ 2 param| 00005bd0 65 74 65 72 73 0d 20 20 20 20 20 20 20 20 45 51 |eters. EQ| 00005be0 55 42 20 26 37 41 20 20 20 20 20 20 20 20 20 20 |UB &7A | 00005bf0 5c 20 77 72 69 74 65 20 73 70 65 63 69 61 6c 20 |\ write special | 00005c00 72 65 67 69 73 74 65 72 20 63 6f 6d 6d 61 6e 64 |register command| 00005c10 0d 20 20 20 20 20 20 20 20 45 51 55 42 20 26 31 |. EQUB &1| 00005c20 32 20 20 20 20 20 20 20 20 20 20 5c 20 74 72 61 |2 \ tra| 00005c30 63 6b 20 72 65 67 69 73 74 65 72 20 64 72 69 76 |ck register driv| 00005c40 65 20 30 2f 32 0d 20 20 20 20 20 20 20 20 45 51 |e 0/2. EQ| 00005c50 55 42 20 26 30 31 20 20 20 20 20 20 20 20 20 20 |UB &01 | 00005c60 5c 20 74 72 61 63 6b 20 31 0d 20 20 20 20 20 20 |\ track 1. | 00005c70 20 20 45 51 55 42 20 26 30 30 20 20 20 20 20 20 | EQUB &00 | 00005c80 20 20 20 20 5c 20 72 65 73 75 6c 74 20 62 79 74 | \ result byt| 00005c90 65 0d 0d 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |e...------------| 00005ca0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00005cb0 2d 2d 2d 2d 0d 4f 73 77 6f 72 64 20 26 37 46 20 |----.Osword &7F | 00005cc0 52 65 61 64 20 53 70 65 63 69 61 6c 20 52 65 67 |Read Special Reg| 00005cd0 69 73 74 65 72 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ister.----------| 00005ce0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00005cf0 2d 2d 2d 2d 2d 2d 0d 0d 54 68 65 20 69 6e 74 65 |------..The inte| 00005d00 72 6e 61 6c 20 72 65 67 69 73 74 65 72 73 20 6f |rnal registers o| 00005d10 66 20 74 68 65 20 38 32 37 31 20 63 61 6e 20 62 |f the 8271 can b| 00005d20 65 20 72 65 61 64 20 75 73 69 6e 67 20 4f 73 77 |e read using Osw| 00005d30 6f 72 64 20 26 37 46 20 52 65 61 64 0d 53 70 65 |ord &7F Read.Spe| 00005d40 63 69 61 6c 20 52 65 67 69 73 74 65 72 2e 20 54 |cial Register. T| 00005d50 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 61 |he contents of a| 00005d60 6c 6c 20 74 68 65 20 72 65 67 69 73 74 65 72 73 |ll the registers| 00005d70 20 69 6e 20 66 69 67 75 72 65 20 34 20 63 61 6e | in figure 4 can| 00005d80 20 62 65 0d 72 65 61 64 20 62 75 74 20 6e 6f 74 | be.read but not| 00005d90 20 61 6c 6c 20 74 68 65 20 72 65 67 69 73 74 65 | all the registe| 00005da0 72 73 20 67 69 76 65 20 75 73 65 66 75 6c 20 72 |rs give useful r| 00005db0 65 73 75 6c 74 73 2e 20 54 68 65 20 64 72 69 76 |esults. The driv| 00005dc0 65 20 63 6f 6e 74 72 6f 6c 0d 69 6e 70 75 74 20 |e control.input | 00005dd0 72 65 67 69 73 74 65 72 20 63 61 6e 20 62 65 20 |register can be | 00005de0 72 65 61 64 20 75 73 69 6e 67 20 4f 73 77 6f 72 |read using Oswor| 00005df0 64 20 26 37 46 20 52 65 61 64 20 44 72 69 76 65 |d &7F Read Drive| 00005e00 20 53 74 61 74 75 73 20 63 6f 6d 6d 61 6e 64 20 | Status command | 00005e10 62 75 74 0d 74 68 65 20 64 72 69 76 65 20 63 6f |but.the drive co| 00005e20 6e 74 72 6f 6c 20 6f 75 74 70 75 74 20 72 65 67 |ntrol output reg| 00005e30 69 73 74 65 72 2c 20 61 6e 64 20 61 6c 6c 20 74 |ister, and all t| 00005e40 68 65 20 6f 74 68 65 72 20 72 65 67 69 73 74 65 |he other registe| 00005e50 72 73 2c 20 68 61 76 65 20 74 6f 20 62 65 0d 72 |rs, have to be.r| 00005e60 65 61 64 20 77 69 74 68 20 74 68 65 20 4f 73 77 |ead with the Osw| 00005e70 6f 72 64 20 26 37 46 20 52 65 61 64 20 53 70 65 |ord &7F Read Spe| 00005e80 63 69 61 6c 20 52 65 67 69 73 74 65 72 20 63 6f |cial Register co| 00005e90 6d 6d 61 6e 64 2e 0d 0d 54 68 65 20 66 6f 6c 6c |mmand...The foll| 00005ea0 6f 77 69 6e 67 20 70 61 72 61 6d 65 74 65 72 20 |owing parameter | 00005eb0 62 6c 6f 63 6b 20 6d 75 73 74 20 62 65 20 75 73 |block must be us| 00005ec0 65 64 20 77 69 74 68 20 74 68 65 20 4f 73 77 6f |ed with the Oswo| 00005ed0 72 64 20 26 37 46 20 52 65 61 64 20 53 70 65 63 |rd &7F Read Spec| 00005ee0 69 61 6c 0d 52 65 67 69 73 74 65 72 20 63 6f 6d |ial.Register com| 00005ef0 6d 61 6e 64 2e 0d 0d 50 61 72 61 6d 65 74 65 72 |mand...Parameter| 00005f00 20 62 6c 6f 63 6b 20 26 30 30 20 20 20 20 20 20 | block &00 | 00005f10 20 3d 20 64 72 69 76 65 20 6e 75 6d 62 65 72 20 | = drive number | 00005f20 28 26 30 30 2d 26 30 33 20 6f 72 20 26 46 46 29 |(&00-&03 or &FF)| 00005f30 0d 50 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b |.Parameter block| 00005f40 20 26 30 31 20 2d 20 26 30 34 20 3d 20 62 75 66 | &01 - &04 = buf| 00005f50 66 65 72 20 61 64 64 72 65 73 73 20 28 6e 6f 74 |fer address (not| 00005f60 20 75 73 65 64 29 0d 50 61 72 61 6d 65 74 65 72 | used).Parameter| 00005f70 20 62 6c 6f 63 6b 20 26 30 35 20 20 20 20 20 20 | block &05 | 00005f80 20 3d 20 26 30 31 20 28 31 20 63 6f 6d 6d 61 6e | = &01 (1 comman| 00005f90 64 20 70 61 72 61 6d 65 74 65 72 29 0d 50 61 72 |d parameter).Par| 00005fa0 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 36 |ameter block &06| 00005fb0 20 20 20 20 20 20 20 3d 20 26 37 44 20 28 72 65 | = &7D (re| 00005fc0 61 64 20 73 70 65 63 69 61 6c 20 72 65 67 69 73 |ad special regis| 00005fd0 74 65 72 20 63 6f 6d 6d 61 6e 64 29 0d 50 61 72 |ter command).Par| 00005fe0 61 6d 65 74 65 72 20 62 6c 6f 63 6b 20 26 30 37 |ameter block &07| 00005ff0 20 20 20 20 20 20 20 3d 20 72 65 67 69 73 74 65 | = registe| 00006000 72 20 6e 75 6d 62 65 72 20 28 66 72 6f 6d 20 66 |r number (from f| 00006010 69 67 75 72 65 20 34 29 0d 50 61 72 61 6d 65 74 |igure 4).Paramet| 00006020 65 72 20 62 6c 6f 63 6b 20 26 30 38 20 20 20 20 |er block &08 | 00006030 20 20 20 3d 20 72 65 73 75 6c 74 20 62 79 74 65 | = result byte| 00006040 0d 0d 0d 54 68 65 20 70 72 6f 67 72 61 6d 20 4f |...The program O| 00006050 55 54 50 55 54 20 64 65 6d 6f 6e 73 74 72 61 74 |UTPUT demonstrat| 00006060 65 73 20 68 6f 77 20 74 6f 20 72 65 61 64 20 74 |es how to read t| 00006070 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74 |he contents of t| 00006080 68 65 20 64 72 69 76 65 0d 63 6f 6e 74 72 6f 6c |he drive.control| 00006090 20 6f 75 74 70 75 74 20 72 65 67 69 73 74 65 72 | output register| 000060a0 20 66 6f 72 20 74 68 65 20 63 75 72 72 65 6e 74 | for the current| 000060b0 20 64 72 69 76 65 2e 20 54 68 65 20 72 65 73 75 | drive. The resu| 000060c0 6c 74 20 69 73 20 70 72 69 6e 74 65 64 20 69 6e |lt is printed in| 000060d0 0d 68 65 78 61 64 65 63 69 6d 61 6c 20 61 6e 64 |.hexadecimal and| 000060e0 20 62 69 6e 61 72 79 2e 20 45 61 63 68 20 62 69 | binary. Each bi| 000060f0 74 20 6f 66 20 74 68 65 20 72 65 73 75 6c 74 20 |t of the result | 00006100 68 61 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e |has the followin| 00006110 67 20 6d 65 61 6e 69 6e 67 3a 0d 0d 62 69 74 20 |g meaning:..bit | 00006120 37 20 3d 20 53 45 4c 45 43 54 20 31 0d 62 69 74 |7 = SELECT 1.bit| 00006130 20 36 20 3d 20 53 45 4c 45 43 54 20 30 0d 62 69 | 6 = SELECT 0.bi| 00006140 74 20 35 20 3d 20 46 41 55 4c 54 20 52 45 53 45 |t 5 = FAULT RESE| 00006150 54 3f 4f 50 30 0d 62 69 74 20 34 20 3d 20 4c 4f |T?OP0.bit 4 = LO| 00006160 57 20 43 55 52 52 45 4e 54 0d 62 69 74 20 33 20 |W CURRENT.bit 3 | 00006170 3d 20 4c 4f 41 44 20 48 45 41 44 0d 62 69 74 20 |= LOAD HEAD.bit | 00006180 32 20 3d 20 44 49 52 45 43 54 49 4f 4e 0d 62 69 |2 = DIRECTION.bi| 00006190 74 20 31 20 3d 20 53 45 45 4b 2f 53 54 45 50 0d |t 1 = SEEK/STEP.| 000061a0 62 69 74 20 30 20 3d 20 57 52 20 45 4e 41 42 4c |bit 0 = WR ENABL| 000061b0 45 0d 0d 0d 49 74 20 69 73 20 69 6e 74 65 72 65 |E...It is intere| 000061c0 73 74 69 6e 67 20 74 6f 20 72 75 6e 20 74 68 65 |sting to run the| 000061d0 20 70 72 6f 67 72 61 6d 20 4f 55 54 50 55 54 20 | program OUTPUT | 000061e0 77 69 74 68 20 64 72 69 76 65 20 30 20 73 65 6c |with drive 0 sel| 000061f0 65 63 74 65 64 20 28 75 73 69 6e 67 0d 2a 44 52 |ected (using.*DR| 00006200 49 56 45 20 30 29 20 61 6e 64 20 74 68 65 6e 20 |IVE 0) and then | 00006210 73 65 6c 65 63 74 20 64 72 69 76 65 20 31 20 28 |select drive 1 (| 00006220 77 69 74 68 20 2a 44 52 49 56 45 20 31 29 20 61 |with *DRIVE 1) a| 00006230 6e 64 20 72 75 6e 20 74 68 65 20 70 72 6f 67 72 |nd run the progr| 00006240 61 6d 0d 61 67 61 69 6e 20 74 6f 20 73 65 65 20 |am.again to see | 00006250 74 68 65 20 64 69 66 66 65 72 65 6e 63 65 20 69 |the difference i| 00006260 74 20 6d 61 6b 65 73 20 74 6f 20 74 68 65 20 72 |t makes to the r| 00006270 65 73 75 6c 74 2e 20 49 66 20 79 6f 75 20 77 61 |esult. If you wa| 00006280 6e 74 20 74 6f 20 72 65 61 64 0d 61 6e 79 20 6f |nt to read.any o| 00006290 74 68 65 72 20 72 65 67 69 73 74 65 72 20 63 68 |ther register ch| 000062a0 61 6e 67 65 20 74 68 65 20 76 61 6c 75 65 20 26 |ange the value &| 000062b0 32 33 20 69 6e 20 6c 69 6e 65 20 31 38 30 20 66 |23 in line 180 f| 000062c0 6f 72 20 61 6e 6f 74 68 65 72 20 72 65 67 69 73 |or another regis| 000062d0 74 65 72 0d 6e 75 6d 62 65 72 20 74 61 6b 65 6e |ter.number taken| 000062e0 20 66 72 6f 6d 20 66 69 67 75 72 65 20 34 2e 0d | from figure 4..| 000062f0 0d 0d 20 20 20 31 30 20 52 45 4d 3a 20 4f 55 54 |.. 10 REM: OUT| 00006300 50 55 54 0d 20 20 20 32 30 20 6f 73 77 72 63 68 |PUT. 20 oswrch| 00006310 3d 26 46 46 45 45 0d 20 20 20 33 30 20 6f 73 77 |=&FFEE. 30 osw| 00006320 6f 72 64 3d 26 46 46 46 31 0d 20 20 20 34 30 20 |ord=&FFF1. 40 | 00006330 44 49 4d 20 6d 63 6f 64 65 20 26 31 30 30 0d 20 |DIM mcode &100. | 00006340 20 20 35 30 20 46 4f 52 20 70 61 73 73 20 3d 20 | 50 FOR pass = | 00006350 30 20 54 4f 20 32 20 53 54 45 50 20 32 0d 20 20 |0 TO 2 STEP 2. | 00006360 20 36 30 20 50 25 3d 6d 63 6f 64 65 0d 20 20 20 | 60 P%=mcode. | 00006370 37 30 20 5b 20 20 20 20 20 20 20 4f 50 54 20 70 |70 [ OPT p| 00006380 61 73 73 0d 20 20 20 38 30 20 20 20 20 20 20 20 |ass. 80 | 00006390 20 20 4c 44 41 20 23 26 37 46 0d 20 20 20 39 30 | LDA #&7F. 90| 000063a0 20 20 20 20 20 20 20 20 20 4c 44 58 20 23 62 6c | LDX #bl| 000063b0 6f 63 6b 20 4d 4f 44 20 32 35 36 0d 20 20 31 30 |ock MOD 256. 10| 000063c0 30 20 20 20 20 20 20 20 20 20 4c 44 59 20 23 62 |0 LDY #b| 000063d0 6c 6f 63 6b 20 44 49 56 20 32 35 36 0d 20 20 31 |lock DIV 256. 1| 000063e0 31 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f |10 JSR o| 000063f0 73 77 6f 72 64 0d 20 20 31 32 30 20 20 20 20 20 |sword. 120 | 00006400 20 20 20 20 52 54 53 0d 20 20 31 33 30 20 2e 62 | RTS. 130 .b| 00006410 6c 6f 63 6b 0d 20 20 31 34 30 20 20 20 20 20 20 |lock. 140 | 00006420 20 20 20 45 51 55 42 20 26 46 46 20 20 20 20 20 | EQUB &FF | 00006430 20 5c 20 63 75 72 72 65 6e 74 20 64 72 69 76 65 | \ current drive| 00006440 0d 20 20 31 35 30 20 20 20 20 20 20 20 20 20 45 |. 150 E| 00006450 51 55 44 20 26 30 30 20 20 20 20 20 20 5c 20 64 |QUD &00 \ d| 00006460 6f 65 73 20 6e 6f 74 20 6d 61 74 74 65 72 0d 20 |oes not matter. | 00006470 20 31 36 30 20 20 20 20 20 20 20 20 20 45 51 55 | 160 EQU| 00006480 42 20 26 30 31 20 20 20 20 20 20 5c 20 31 20 70 |B &01 \ 1 p| 00006490 61 72 61 6d 65 74 65 72 0d 20 20 31 37 30 20 20 |arameter. 170 | 000064a0 20 20 20 20 20 20 20 45 51 55 42 20 26 37 44 20 | EQUB &7D | 000064b0 20 20 20 20 20 5c 20 72 65 61 64 20 73 70 65 63 | \ read spec| 000064c0 69 61 6c 20 72 65 67 69 73 74 65 72 20 63 6f 6d |ial register com| 000064d0 6d 61 6e 64 0d 20 20 31 38 30 20 20 20 20 20 20 |mand. 180 | 000064e0 20 20 20 45 51 55 42 20 26 32 33 20 20 20 20 20 | EQUB &23 | 000064f0 20 5c 20 64 72 69 76 65 20 63 6f 6e 74 72 6f 6c | \ drive control| 00006500 20 6f 75 74 70 75 74 20 72 65 67 69 73 74 65 72 | output register| 00006510 0d 20 20 31 39 30 20 2e 72 65 73 75 6c 74 0d 20 |. 190 .result. | 00006520 20 32 30 30 20 20 20 20 20 20 20 20 20 45 51 55 | 200 EQU| 00006530 42 20 26 30 30 20 20 20 20 20 20 5c 20 72 65 73 |B &00 \ res| 00006540 75 6c 74 20 62 79 74 65 0d 20 20 32 31 30 20 2e |ult byte. 210 .| 00006550 62 69 6e 61 72 79 0d 20 20 32 32 30 20 20 20 20 |binary. 220 | 00006560 20 20 20 20 20 4c 44 58 20 23 38 0d 20 20 32 33 | LDX #8. 23| 00006570 30 20 2e 6c 6f 6f 70 0d 20 20 32 34 30 20 20 20 |0 .loop. 240 | 00006580 20 20 20 20 20 20 4c 44 41 20 23 41 53 43 28 22 | LDA #ASC("| 00006590 30 22 29 0d 20 20 32 35 30 20 20 20 20 20 20 20 |0"). 250 | 000065a0 20 20 41 53 4c 20 72 65 73 75 6c 74 0d 20 20 32 | ASL result. 2| 000065b0 36 30 20 20 20 20 20 20 20 20 20 41 44 43 20 23 |60 ADC #| 000065c0 26 30 30 0d 20 20 32 37 30 20 20 20 20 20 20 20 |&00. 270 | 000065d0 20 20 4a 53 52 20 6f 73 77 72 63 68 0d 20 20 32 | JSR oswrch. 2| 000065e0 38 30 20 20 20 20 20 20 20 20 20 44 45 58 0d 20 |80 DEX. | 000065f0 20 32 39 30 20 20 20 20 20 20 20 20 20 42 4e 45 | 290 BNE| 00006600 20 6c 6f 6f 70 0d 20 20 33 30 30 20 20 20 20 20 | loop. 300 | 00006610 20 20 20 20 52 54 53 0d 20 20 33 31 30 20 5d 0d | RTS. 310 ].| 00006620 20 20 33 32 30 20 4e 45 58 54 0d 20 20 33 33 30 | 320 NEXT. 330| 00006630 20 43 41 4c 4c 20 6d 63 6f 64 65 0d 20 20 33 34 | CALL mcode. 34| 00006640 30 20 50 52 49 4e 54 22 52 65 73 75 6c 74 20 3d |0 PRINT"Result =| 00006650 20 26 22 3b 7e 3f 72 65 73 75 6c 74 3b 22 2c 20 | &";~?result;", | 00006660 25 22 3b 0d 20 20 33 35 30 20 43 41 4c 4c 20 62 |%";. 350 CALL b| 00006670 69 6e 61 72 79 0d 20 20 33 36 30 20 50 52 49 4e |inary. 360 PRIN| 00006680 54 0d |T.| 00006682