     $DBA5/56229:   Directory entry

    Jump from $DB23, $DB5C:

    DBA5: A6 82     LDX $82         ; channel number
    DBA7: 8E 70 02  STX $0270       ; save
    DBAA: A5 83     LDA $83         ; secondary address
    DBAC: 48        PHA             ; save
    DBAD: BD 60 02  LDA $0260,X     ; sector number in directory
    DBB0: 85 81     STA $81         ; set
    DBB2: BD 66 02  LDA $0266,X     ; pointer in directory
    DBB5: 8D 94 02  STA $0294
    DBB8: B5 EC     LDA $EC,X
    DBBA: 29 01     AND #$01
    DBBC: 85 7F     STA $7F         ; drive number
    DBBE: AD 85 FE  LDA $FE85       ; 18, directory track
    DBC1: 85 80     STA $80         ; set
    DBC3: 20 93 DF  JSR $DF93       ; increment buffer number
    DBC6: 48        PHA
    DBC7: 85 F9     STA $F9
    DBC9: 20 60 D4  JSR $D460       ; read directory block
    DBCC: A0 00     LDY #$00
    DBCE: BD E0 FE  LDA $FEE0,X     ; buffer address
    DBD1: 85 87     STA $87
    DBD3: AD 94 02  LDA $0294       ; buffer pointer
    DBD6: 85 86     STA $86
    DBD8: B1 86     LDA ($86),Y     ; file type
    DBDA: 29 20     AND #$20        ; file closed?
    DBDC: F0 43     BEQ $DC21       ; yes
    DBDE: 20 25 D1  JSR $D125       ; check file type
    DBE1: C9 04     CMP #$04        ; rel-file?
    DBE3: F0 44     BEQ $DC29       ; yes
    DBE5: B1 86     LDA ($86),Y
    DBE7: 29 8F     AND #$8F        ; erase bits 4,5, and 6
    DBE9: 91 86     STA ($86),Y     ; in file type
    DBEB: C8        INY
    DBEC: B1 86     LDA ($86),Y     ; track number
    DBEE: 85 80     STA $80
    DBF0: 84 71     STY $71
    DBF2: A0 1B     LDY #$1B
    DBF4: B1 86     LDA ($86),Y     ; sector number of the file for
    DBF6: 48        PHA             ; overwriting
    DBF7: 88        DEY
    DBF8: B1 86     LDA ($86),Y     ; track number for overwriting
    DBFA: D0 0A     BNE $DC06       ; set?
    DBFC: 85 80     STA $80         ; set track number
    DBFE: 68        PLA
    DBFF: 85 81     STA $81         ; sector number
    DC01: A9 67     LDA #$67
    DC03: 20 45 E6  JSR $E645       ; 67, 'illegal track or sector'

    Jump from $DBFA:

    DC06: 48        PHA
    DC07: A9 00     LDA #$00
    DC09: 91 86     STA ($86),Y     ; erase track number
    DC0B: C8        INY
    DC0C: 91 86     STA ($86),Y     ; and sector number of the
    DC0E: 68        PLA             ; substitute file
    DC0F: A4 71     LDY $71
    DC11: 91 86     STA ($86),Y
    DC13: C8        INY             ; set track & sector number of the new file
    DC14: B1 86     LDA ($86),Y
    DC16: 85 81     STA $81
    DC18: 68        PLA
    DC19: 91 86     STA ($86),Y
    DC1B: 20 7D C8  JSR $C87D       ; erase all files
    DC1E: 4C 29 DC  JMP $DC29

    Jump from $DBDC:

    DC21: B1 86     LDA ($86),Y     ; get file type
    DC23: 29 0F     AND #$0F        ; isolate bits 0-3
    DC25: 09 80     ORA #$80        ; set bit 7 for closed file
    DC27: 91 86     STA ($86),Y

    Jump from $DBE3, $DC1E:

    DC29: AE 70 02  LDX $0270       ; channel number
    DC2C: A0 1C     LDY #$1C
    DC2E: B5 B5     LDA $B5,X       ; block number lo
    DC30: 91 86     STA ($86),Y     ; in directory entry
    DC32: C8        INY
    DC33: B5 BB     LDA $BB,X       ; and block number hi
    DC35: 91 86     STA ($86),Y     ; write
    DC37: 68        PLA             ; buffer number
    DC38: AA        TAX
    DC39: A9 90     LDA #$90        ; code for 'writing'
    DC3B: 05 7F     ORA $7F
    DC3D: 20 90 D5  JSR $D590       ; write block
    DC40: 68        PLA
    DC41: 85 83     STA $83         ; secondary address
    DC43: 4C 07 D1  JMP $D107       ; open channel for writing

        Previous Page / Next Page