     $EAA0/60064:   Power-up RESET routine

    EAA0: 78        SEI
    EAA1: D8        CLD
    EAA2: A2 FF     LDX #$FF
    EAA4: 4C 10 FF  JMP $FF10       ; port A to output

    Jump from $FF1D:

    EAA7: E8        INX
    EAA8: A0 00     LDY #$00
    EAAA: A2 00     LDX #$00

    Jump from $EAB0:

    EAAC: 8A        TXA
    EAAD: 95 00     STA $00,X       ; erase zero page
    EAAF: E8        INX
    EAB0: D0 FA     BNE $EAAC

    Jump from $EAC7:

    EAB2: 8A        TXA
    EAB3: D5 00     CMP $00,X       ; is byte erased?
    EAB5: D0 B7     BNE $EA6E       ; no, then to error display (blink)

    Jump from $EABA:

    EAB7: F6 00     INC $00,X
    EAB9: C8        INY
    EABA: D0 FB     BNE $EAB7
    EABC: D5 00     CMP $00,X
    EABE: D0 AE     BNE $EA6E       ; error
    EAC0: 94 00     STY $00,X
    EAC2: B5 00     LDA $00,X
    EAC4: D0 A8     BNE $EA6E       ; error
    EAC6: E8        INX
    EAC7: D0 E9     BNE $EAB2

    Jump from $EAE8:

    EAC9: E6 6F     INC $6F
    EACB: 86 76     STX $76
    EACD: A9 00     LDA #$00
    EACF: 85 75     STA $75
    EAD1: A8        TAY
    EAD2: A2 20     LDX #$20        ; test 32 pages
    EAD4: 18        CLC

    Jump from $EADD:

    EAD5: C6 76     DEC $76

    Jump from $EADA:

    EAD7: 71 75     ADC ($75),Y
    EAD9: C8        INY
    EADA: D0 FB     BNE $EAD7
    EADC: CA        DEX
    EADD: D0 F6     BNE $EAD5       ; test ROM
    EADF: 69 00     ADC #$00
    EAE1: AA        TAX
    EAE2: C5 76     CMP $76
    EAE4: D0 39     BNE $EB1F       ; ROM error
    EAE6: E0 C0     CPX #$C0
    EAE8: D0 DF     BNE $EAC9
    EAEA: A9 01     LDA #$01
    EAEC: 85 76     STA $76
    EAEE: E6 6F     INC $6F
    EAF0: A2 07     LDX #$07        ; test RAM, beginning at page 7

    Jump from $EAF9, $EAFE:

    EAF2: 98        TYA
    EAF3: 18        CLC
    EAF4: 65 76     ADC $76
    EAF6: 91 75     STA ($75),Y
    EAF8: C8        INY
    EAF9: D0 F7     BNE $EAF2
    EAFB: E6 76     INC $76
    EAFD: CA        DEX
    EAFE: D0 F2     BNE $EAF2
    EB00: A2 07     LDX #$07

    Jump from $EB1B:

    EB02: C6 76     DEC $76

    Jump from $EB18:

    EB04: 88        DEY
    EB05: 98        TYA
    EB06: 18        CLC
    EB07: 65 76     ADC $76
    EB09: D1 75     CMP ($75),Y
    EB0B: D0 12     BNE $EB1F       ; RAM error
    EB0D: 49 FF     EOR #$FF
    EB0F: 91 75     STA ($75),Y
    EB11: 51 75     EOR ($75),Y
    EB13: 91 75     STA ($75),Y
    EB15: D0 08     BNE $EB1F       ; RAM error
    EB17: 98        TYA
    EB18: D0 EA     BNE $EB04
    EB1A: CA        DEX
    EB1B: D0 E5     BNE $EB02       ; continue test
    EB1D: F0 03     BEQ $EB22       ; ok

    Jump from $EAE4, $EB0B, $EB15:

    EB1F: 4C 71 EA  JMP $EA71       ; to error display

    Jump from $EB1D:

    EB22: A2 45     LDX #$45
    EB24: 9A        TXS             ; initialize stack pointer
    EB25: AD 00 1C  LDA $1C00
    EB28: 29 F7     AND #$F7        ; turn LED off
    EB2A: 8D 00 1C  STA $1C00
    EB2D: A9 01     LDA #$01
    EB2F: 8D 0C 18  STA $180C       ; CA1 (ATN IN) trigger on positive edge
    EB32: A9 82     LDA #$82
    EB34: 8D 0D 18  STA $180D       ; interrupt possible through ATN IN
    EB37: 8D 0E 18  STA $180E
    EB3A: AD 00 18  LDA $1800       ; read port B
    EB3D: 29 60     AND #$60        ; isolate bits 5 & 6 (device number)
    EB3F: 0A        ASL
    EB40: 2A        ROL
    EB41: 2A        ROL             ; rotate to bit positions 0 & 1
    EB42: 2A        ROL
    EB43: 09 48     ORA #$48        ; add offset from 8 + $40 for TALK
    EB45: 85 78     STA $78         ; device number for TALK (send)
    EB47: 49 60     EOR #$60        ; erase bit 6, set bit 5
    EB49: 85 77     STA $77         ; device number + $20 for LISTEN
    EB4B: A2 00     LDX #$00
    EB4D: A0 00     LDY #$00

    Jump from $EB5D:

    EB4F: A9 00     LDA #$00
    EB51: 95 99     STA $99,X       ; low-byte of buffer address
    EB53: E8        INX
    EB54: B9 E0 FE  LDA $FEE0,Y     ; high-byte of address from table
    EB57: 95 99     STA $99,X       ; save
    EB59: E8        INX
    EB5A: C8        INY
    EB5B: C0 05     CPY #$05
    EB5D: D0 F0     BNE $EB4F
    EB5F: A9 00     LDA #$00
    EB61: 95 99     STA $99,X
    EB63: E8        INX             ; pointer $A3/$A4 to $200, input buffer
    EB64: A9 02     LDA #$02
    EB66: 95 99     STA $99,X
    EB68: E8        INX
    EB69: A9 D5     LDA #$D5
    EB6B: 95 99     STA $99,X
    EB6D: E8        INX             ; pointer $A5/$A6 to $2D5, error
    EB6E: A9 02     LDA #$02        ; message pointer
    EB70: 95 99     STA $99,X
    EB72: A9 FF     LDA #$FF
    EB74: A2 12     LDX #$12

    Jump from $EB7A:

    EB76: 9D 2B 02  STA $022B,X     ; fill channel table with $FF
    EB79: CA        DEX
    EB7A: 10 FA     BPL $EB76
    EB7C: A2 05     LDX #$05

    Jump from $EB85:

    EB7E: 95 A7     STA $A7,X       ; erase buffer table
    EB80: 95 AE     STA $AE,X
    EB82: 95 CD     STA $CD,X       ; erase side-sector table
    EB84: CA        DEX
    EB85: 10 F7     BPL $EB7E
    EB87: A9 05     LDA #$05        ; buffer 5
    EB89: 85 AB     STA $AB         ; associate with channel 4
    EB8B: A9 06     LDA #$06        ; buffer 4
    EB8D: 85 AC     STA $AC         ; associate with channel 5
    EB8F: A9 FF     LDA #$FF
    EB91: 85 AD     STA $AD
    EB93: 85 B4     STA $B4
    EB95: A9 05     LDA #$05
    EB97: 8D 3B 02  STA $023B       ; channel 5 WRITE flag erased
    EB9A: A9 84     LDA #$84
    EB9C: 8D 3A 02  STA $023A       ; channel 4 WRITE flag set
    EB9F: A9 0F     LDA #$0F        ; initialize channel allocation register
    EBA1: 8D 56 02  STA $0256       ; bit '1' equals channel free
    EBA4: A9 01     LDA #$01
    EBA6: 85 F6     STA $F6         ; WRITE flag
    EBA8: A9 88     LDA #$88
    EBAA: 85 F7     STA $F7         ; READ flag
    EBAC: A9 E0     LDA #$E0        ; 5 buffers free
    EBAE: 8D 4F 02  STA $024F       ; initialize buffer allocation register
    EBB1: A9 FF     LDA #$FF        ; $24F/$250, 16 bit
    EBB3: 8D 50 02  STA $0250
    EBB6: A9 01     LDA #$01
    EBB8: 85 1C     STA $1C         ; flag for WRITE protect
    EBBA: 85 1D     STA $1D
    EBBC: 20 63 CB  JSR $CB63       ; set vector for U0
    EBBF: 20 FA CE  JSR $CEFA       ; initialize channel table
    EBC2: 20 59 F2  JSR $F259       ; initialization for disk controller
    EBC5: A9 22     LDA #$22
    EBC7: 85 65     STA $65
    EBC9: A9 EB     LDA #$EB        ; pointer $65/$66 to $EB22
    EBCB: 85 66     STA $66
    EBCD: A9 0A     LDA #$0A
    EBCF: 85 69     STA $69         ; step width 10
    EBD1: A9 05     LDA #$05        ; for sector assignment
    EBD3: 85 6A     STA $6A         ; 5 read attempts
    EBD5: A9 73     LDA #$73        ; prepare power-up message
    EBD7: 20 C1 E6  JSR $E6C1       ; 73, 'cbm dos v2.6 1541'
    EBDA: A9 00     LDA #$00        ; bit 1, 3 & 4 to output
    EBDC: 8D 00 18  STA $1800       ; data direction of port B
    EBDF: A9 1A     LDA #$1A
    EBE1: 8D 02 18  STA $1802       ; erase data register
    EBE4: 20 80 E7  JSR $E780       ; check for auto-start

    Jump from $E698, $E8EA, $EA53:

    EBE7: 58        CLI
    EBE8: AD 00 18  LDA $1800
    EBEB: 29 E5     AND #$E5        ; reset serial port
    EBED: 8D 00 18  STA $1800
    EBF0: AD 55 02  LDA $0255       ; command flag set?
    EBF3: F0 0A     BEQ $EBFF       ; no
    EBF5: A9 00     LDA #$00
    EBF7: 8D 55 02  STA $0255       ; reset command flag
    EBFA: 85 67     STA $67
    EBFC: 20 46 C1  JSR $C146       ; analyze and execute command

        Previous Page / Next Page