     $CB84/52100:   Open direct access channel, number

    Jump from $D819:

    CB84: AD 8E 02  LDA $028E       ; last drive number
    CB87: 85 7F     STA $7F         ; drive number
    CB89: A5 83     LDA $83         ; channel number
    CB8B: 48        PHA
    CB8C: 20 3D C6  JSR $C63D       ; check drive and initialize
    CB8F: 68        PLA
    CB90: 85 83     STA $83
    CB92: AE 74 02  LDX $0274       ; length of filename
    CB95: CA        DEX
    CB96: D0 0D     BNE $CBA5       ; greater than one?
    CB98: A9 01     LDA #$01
    CB9A: 20 E2 D1  JSR $D1E2       ; layout buffer and channel
    CB9D: 4C F1 CB  JMP $CBF1       ; set flags, done

    Jump from $CBAF, $CBC4, $CBCB:

    CBA0: A9 70     LDA #$70
    CBA2: 4C C8 C1  JMP $C1C8       ; 70, 'no channel'

    Jump from $CB96:

    CBA5: A0 01     LDY #$01
    CBA7: 20 7C CC  JSR $CC7C       ; get buffer number
    CBAA: AE 85 02  LDX $0285       ; buffer number
    CBAD: E0 05     CPX #$05        ; bigger than 5?
    CBAF: B0 EF     BCS $CBA0       ; 70, 'no channel'
    CBB1: A9 00     LDA #$00
    CBB3: 85 6F     STA $6F
    CBB5: 85 70     STA $70
    CBB7: 38        SEC

    Jump from $CBBD:

    CBB8: 26 6F     ROL $6F
    CBBA: 26 70     ROL $70
    CBBC: CA        DEX
    CBBD: 10 F9     BPL $CBB8
    CBBF: A5 6F     LDA $6F
    CBC1: 2D 4F 02  AND $024F
    CBC4: D0 DA     BNE $CBA0
    CBC6: A5 70     LDA $70
    CBC8: 2D 50 02  AND $0250
    CBCB: D0 D3     BNE $CBA0
    CBCD: A5 6F     LDA $6F
    CBCF: 0D 4F 02  ORA $024F
    CBD2: 8D 4F 02  STA $024F
    CBD5: A5 70     LDA $70
    CBD7: 0D 50 02  ORA $0250
    CBDA: 8D 50 02  STA $0250
    CBDD: A9 00     LDA #$00
    CBDF: 20 E2 D1  JSR $D1E2       ; search channel
    CBE2: A6 82     LDX $82         ; channel number
    CBE4: AD 85 02  LDA $0285       ; buffer number
    CBE7: 95 A7     STA $A7,X
    CBE9: AA        TAX
    CBEA: A5 7F     LDA $7F         ; drive number
    CBEC: 95 00     STA $00,X
    CBEE: 9D 5B 02  STA $025B,X

    Jump from $CB9D:

    CBF1: A6 83     LDX $83         ; secondary address
    CBF3: BD 2B 02  LDA $022B,X
    CBF6: 09 40     ORA #$40        ; set READ and WRITE flags
    CBF8: 9D 2B 02  STA $022B,X
    CBFB: A4 82     LDY $82         ; channel number
    CBFD: A9 FF     LDA #$FF
    CBFF: 99 44 02  STA $0244,Y     ; end pointer
    CC02: A9 89     LDA #$89
    CC04: 99 F2 00  STA $F2,Y       ; set READ and WRITE flags
    CC07: B9 A7 00  LDA $A7,Y       ; buffer number
    CC0A: 99 3E 02  STA $023E,Y
    CC0D: 0A        ASL             ; times 2
    CC0E: AA        TAX
    CC0F: A9 01     LDA #$01
    CC11: 95 99     STA $99,X       ; buffer pointer to one
    CC13: A9 0E     LDA #$0E
    CC15: 99 EC 00  STA $EC,Y       ; flag for direct access
    CC18: 4C 94 C1  JMP $C194       ; done

        Previous Page / Next Page