     $D6E4/55012:   Enter file in dir

    Jump from $C9B3, $D9EC:

    D6E4: A5 83     LDA $83         ; secondary address
    D6E6: 48        PHA
    D6E7: A5 82     LDA $82         ; channel number
    D6E9: 48        PHA
    D6EA: A5 81     LDA $81         ; sector number
    D6EC: 48        PHA
    D6ED: A5 80     LDA $80         ; track number
    D6EF: 48        PHA             ; save
    D6F0: A9 11     LDA #$11
    D6F2: 85 83     STA $83         ; secondary address 17
    D6F4: 20 3B DE  JSR $DE3B       ; get track and sector number
    D6F7: AD 4A 02  LDA $024A       ; file type
    D6FA: 48        PHA             ; save
    D6FB: A5 E2     LDA $E2         ; drive number
    D6FD: 29 01     AND #$01
    D6FF: 85 7F     STA $7F         ; set
    D701: A6 F9     LDX $F9         ; buffer number
    D703: 5D 5B 02  EOR $025B,X
    D706: 4A        LSR
    D707: 90 0C     BCC $D715       ; equal drive number?
    D709: A2 01     LDX #$01
    D70B: 8E 92 02  STX $0292       ; pointer in directory
    D70E: 20 AC C5  JSR $C5AC       ; load dir and find first entry
    D711: F0 1D     BEQ $D730       ; not found?
    D713: D0 28     BNE $D73D       ; found?

    Jump from $D707:

    D715: AD 91 02  LDA $0291       ; sector number in directory
    D718: F0 0C     BEQ $D726       ; equal zero
    D71A: C5 81     CMP $81         ; equal sector number?
    D71C: F0 1F     BEQ $D73D       ; yes
    D71E: 85 81     STA $81         ; save sector number
    D720: 20 60 D4  JSR $D460       ; read block
    D723: 4C 3D D7  JMP $D73D

    Jump from $D718:

    D726: A9 01     LDA #$01
    D728: 8D 92 02  STA $0292       ; pointer to one
    D72B: 20 17 C6  JSR $C617       ; find next entry in directory
    D72E: D0 0D     BNE $D73D       ; found?

    Jump from $D711:

    D730: 20 8D D4  JSR $D48D       ; write directory block
    D733: A5 81     LDA $81         ; sector number
    D735: 8D 91 02  STA $0291
    D738: A9 02     LDA #$02
    D73A: 8D 92 02  STA $0292       ; pointer to 2

    Jump from $D713, $D71C, $D723, $D72E:

    D73D: AD 92 02  LDA $0292
    D740: 20 C8 D4  JSR $D4C8       ; set buffer pointer
    D743: 68        PLA
    D744: 8D 4A 02  STA $024A       ; file type
    D747: C9 04     CMP #$04        ; rel-file?
    D749: D0 02     BNE $D74D       ; no
    D74B: 09 80     ORA #$80        ; set bit 7

    Jump from $D749:

    D74D: 20 F1 CF  JSR $CFF1       ; and write in buffer
    D750: 68        PLA
    D751: 8D 80 02  STA $0280       ; following track
    D754: 20 F1 CF  JSR $CFF1       ; in buffer
    D757: 68        PLA
    D758: 8D 85 02  STA $0285       ; following sector
    D75B: 20 F1 CF  JSR $CFF1       ; in buffer
    D75E: 20 93 DF  JSR $DF93       ; get buffer number
    D761: A8        TAY
    D762: AD 7A 02  LDA $027A       ; pointer to drive number
    D765: AA        TAX
    D766: A9 10     LDA #$10        ; 16, length of filename
    D768: 20 6E C6  JSR $C66E       ; write filename in buffer
    D76B: A0 10     LDY #$10
    D76D: A9 00     LDA #$00

    Jump from $D774:

    D76F: 91 94     STA ($94),Y     ; fill with zeroes at position 16
    D771: C8        INY
    D772: C0 1B     CPY #$1B        ; position 27 already?
    D774: 90 F9     BCC $D76F       ; no
    D776: AD 4A 02  LDA $024A       ; file type
    D779: C9 04     CMP #$04        ; rel-file?
    D77B: D0 13     BNE $D790       ; no
    D77D: A0 10     LDY #$10
    D77F: AD 59 02  LDA $0259       ; track
    D782: 91 94     STA ($94),Y
    D784: C8        INY
    D785: AD 5A 02  LDA $025A       ; and sector
    D788: 91 94     STA ($94),Y     ; the side-sectors in directory entry
    D78A: C8        INY
    D78B: AD 58 02  LDA $0258       ; record length
    D78E: 91 94     STA ($94),Y     ; in directory

    Jump from $D77B:

    D790: 20 64 D4  JSR $D464       ; write block
    D793: 68        PLA
    D794: 85 82     STA $82         ; channel number
    D796: AA        TAX
    D797: 68        PLA
    D798: 85 83     STA $83         ; secondary address
    D79A: AD 91 02  LDA $0291
    D79D: 85 D8     STA $D8
    D79F: 9D 60 02  STA $0260,X
    D7A2: AD 92 02  LDA $0292
    D7A5: 85 DD     STA $DD
    D7A7: 9D 66 02  STA $0266,X
    D7AA: AD 4A 02  LDA $024A       ; file type
    D7AD: 85 E7     STA $E7
    D7AF: A5 7F     LDA $7F         ; drive number
    D7B1: 85 E2     STA $E2
    D7B3: 60        RTS

        Previous Page / Next Page