     $EEF4/61172:   Write BAM if needed

    Jump from $C8A7, $DB26, $DD87, $E433:

    EEF4: 20 93 DF  JSR $DF93       ; get buffer number
    EEF7: AA        TAX
    EEF8: BD 5B 02  LDA $025B,X     ; command for disk controller
    EEFB: 29 01     AND #$01
    EEFD: 85 7F     STA $7F         ; isolate drive number

    Jump from $EDAD, $EEA0:

    EEFF: A4 7F     LDY $7F
    EF01: B9 51 02  LDA $0251,Y     ; BAM-changed flag set?
    EF04: D0 01     BNE $EF07       ; yes
    EF06: 60        RTS

    Jump from $EF04:

    EF07: A9 00     LDA #$00
    EF09: 99 51 02  STA $0251,Y     ; reset BAM-changed flag
    EF0C: 20 3A EF  JSR $EF3A       ; set buffer pointer for BAM
    EF0F: A5 7F     LDA $7F         ; drive number
    EF11: 0A        ASL             ; times 2
    EF12: 48        PHA
    EF13: 20 A5 F0  JSR $F0A5       ; verify BAM entry
    EF16: 68        PLA
    EF17: 18        CLC
    EF18: 69 01     ADC #$01        ; inrement track number
    EF1A: 20 A5 F0  JSR $F0A5       ; verify BAM entry
    EF1D: A5 80     LDA $80         ; track
    EF1F: 48        PHA
    EF20: A9 01     LDA #$01        ; track 1
    EF22: 85 80     STA $80

    Jump from $EF32:

    EF24: 0A        ASL             ; times 4
    EF25: 0A        ASL
    EF26: 85 6D     STA $6D
    EF28: 20 20 F2  JSR $F220       ; verify BAM
    EF2B: E6 80     INC $80         ; increment track number
    EF2D: A5 80     LDA $80
    EF2F: CD D7 FE  CMP $FED7       ; and compare with max val + 1 = 36
    EF32: 90 F0     BCC $EF24       ; ok, next track
    EF34: 68        PLA
    EF35: 85 80     STA $80         ; get track number back
    EF37: 4C 8A D5  JMP $D58A       ; write BAM to disk

        Previous Page / Next Page