
 1000  *SAVE TRACK READ
 1010  *--------------------------------
 1020  SLOT    .EQ $00     $60 OR $70
 1030  DRIVE   .EQ $01     1 OR 2
 1040  VOLUME  .EQ $02     0 = DON'T CARE
 1050  TRACK   .EQ $03     $00 TO $22
 1060  SECTOR  .EQ $04     $00 TO $0F
 1070  BUFFER  .EQ $05,06   
 1080  COMMAND .EQ $07     1 = READ, 2 = WRITE
 1090  PREG    .EQ $48
 1100  *
 1110  RWTS    .EQ $3D9
 1120  *
 1130  IOB         .EQ $B7E8    DOS'S OWN IOB
 1140  IOB.SLOT    .EQ $B7E9
 1150  IOB.DRIVE   .EQ $B7EA
 1160  IOB.VOLUME  .EQ $B7EB
 1170  IOB.TRACK   .EQ $B7EC
 1180  IOB.SECTOR  .EQ $B7ED
 1190  IOB.BUFFER  .EQ $B7F0,F1
 1200  IOB.COMMAND .EQ $B7F4
 1210  IOB.ERROR   .EQ $B7F5
 1220  *
 1230  PRBYTE .EQ $FDDA
 1240  COUT   .EQ $FDED
 1250  *--------------------------------
 1260  SETUP
 1270         LDA #$60
 1280         STA SLOT     SLOT 6
 1290         LDA #$01
 1300         STA DRIVE    DRIVE 1
 1310         LDA #$00
 1320         STA VOLUME   ANY VOLUME
 1330         JSR GET.TRACK
 1340         JSR GET.BUFFER
 1350         JSR GET.COMMAND
 1360  *--------------------------------
 1370  READ.TRACK
 1380         LDA #$0F     START AT SECTOR $0F
 1390         STA SECTOR
 1400  .1     JSR RWTS.CALLER   READ ONE SECTOR
 1410         BCS EXIT     EXIT IF ERROR
 1420         INC BUFFER+1 NEXT BUFFER PAGE
 1430         DEC SECTOR   NEXT SECTOR
 1440         BPL .1       NOT DONE, READ NEXT SECTOR
 1450  *--------------------------------
 1460  DISPLAY
 1470  *--------------------------------
 1480  EXIT   RTS
 1490  *--------------------------------
 1500  GET.TRACK
 1510         LDA #$11
 1520         STA TRACK    TRACK $11 (DIRECTORY)
 1530         RTS
 1540  *--------------------------------
 1550  GET.BUFFER
 1560         LDA #0
 1570         STA BUFFER   BUFFER AT $4000
 1580         LDA #$40
 1590         STA BUFFER+1
 1600         RTS
 1605         .PG
 1610  *--------------------------------
 1620  GET.COMMAND
 1630         LDA #1
 1640         STA COMMAND  READ
 1650         RTS
 1660  *--------------------------------
 1670  RWTS.CALLER
 1680         LDA SLOT     TRANSFER
 1690         STA IOB.SLOT  VALUES
 1700         LDA DRIVE      INTO
 1710         STA IOB.DRIVE   IOB
 1720         LDA VOLUME
 1730         STA IOB.VOLUME
 1740         LDA TRACK
 1750         STA IOB.TRACK
 1760         LDA SECTOR
 1770         STA IOB.SECTOR
 1780         LDA COMMAND
 1790         STA IOB.COMMAND
 1800         LDA BUFFER
 1810         STA IOB.BUFFER
 1820         LDA BUFFER+1
 1830         STA IOB.BUFFER+1
 1840         LDA #$00
 1850         STA IOB.ERROR
 1860  *--------------------------------
 1870         LDY #IOB     LOAD IOB
 1880         LDA /IOB     ADDRESS
 1890         JSR RWTS     CALL RWTS
 1900         LDA #$00
 1910         STA PREG     SOOTHE MONITOR
 1920         BCS ERROR.HANDLER
 1930         RTS
 1940  *--------------------------------
 1950  ERROR.HANDLER
 1960         LDA #$87     BELL
 1970         JSR COUT     RING
 1980         JSR COUT        ING
 1990         JSR COUT          ING
 2000         LDA IOB.ERROR
 2010         JSR PRBYTE   DISPLAY ERROR CODE
 2020         SEC          EXIT WITH CARRY SET
 2030         RTS

