[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Boot ROM + Prodos loader listing with comments



sanjaya wrote:
Hi,

I am trying to find a easyway out in getting to know few things about
Boot ROM and Prodos loader...

Does anyone has the disk drive BootROM listing and Prodos loader
listing (initial 256 bytes) with comments?

thanks,

This is about all I have kicking around...

It's not all commented but google around a bit and you'll find more info. E.g. (look for IWM docs).

c600: a2 20        ldx #$20
c602: a0 00        ldy #$00
c604: a2 03        ldx #$03
c606: 86 3c        stx $3c
c608: 8a           txa
c609: 0a           asl
c60a: 24 3c        bit $3c
c60c: f0 10        beq $c61e
c60e: 05 3c        ora $3c
c610: 49 ff        eor #$ff
c612: 29 7e        and #$7e
c614: b0 08        bcs $c61e
c616: 4a           lsr
c617: d0 fb        bne $c614
c619: 98           tya
c61a: 9d 56 03     sta $0356,X
c61d: c8           iny
c61e: e8           inx
c61f: 10 e5        bpl $c606

c621: 20 58 ff     jsr $ff58
c624: ba           tsx
c625: bd 00 01     lda $0100,x
c628: 0a           asl
c629: 0a           asl
c62a: 0a           asl
c62b: 0a           asl
c62c: 85 2b        sta $2b
c62e: aa           tax
c62f: bd 8e c0     lda $c08e,x
c632: bd 8c c0     lda $c08c,x
c635: bd 8a c0     lda $c08a,x
c638: bd 89 c0     lda $c089,x
c63b: a0 50        ldy #$50

c63d: bd 80 c0     lda $c080,x
c640: 98           tya
c641: 29 03        and #$03
c643: 0a           asl
c644: 05 2b        ora $2b
c646: aa           tax
c647: bd 81 c0     lda $c081,x
c64a: a9 56        lda #$56
c64c: 20 a8 fc     jsr $fca8    ; WAIT
c64f: 88           dey
c650: 10 eb        bpl $c63d

c652: 85 26        sta $26      ; zero
c654: 85 3d        sta $3d      ;   desired sector
c656: 85 41        sta $41      ;   desired track
c658: a9 08        lda #$08
c65a: 85 27        sta $27

ReadAddrProlog
c65c:  18          clc          ; address field
                                ; CS ==> data field
ReadDataProlog
c65d: 08           php

ReadProlog
c65e: bd 8c c0     lda $c08c,x
c661: 10 fb        bpl ReadProlog

c663: 49 d5        eor #$d5
c665: d0 f7        bne ReadProlog

:1
c667: bd 8c c0     lda $c08c,x
c66a: 10 fb        bpl :1
c66c: c9 aa        cmp #$aa
c66e: d0 f3        bne $c663
c670: ea           nop

:2
c671: bd 8c c0     lda $c08c,x
c674: 10 fb        bpl :2
c676: c9 96        cmp #$96
c678: f0 09        beq ReadAddress

c67a: 28           plp

c67b: 90 df        bcc $c65e
c67d: 49 ad        eor #$ad
c67f: f0 25        beq ReadSectorData
c681: d0 d9        bne ReadAddrProlog

ReadAddress
c683: a0 03        ldy #$03     ; read three bytes Vol, Track, Sector
                                ; ignoring the volume and track
ReadAddr1
c685: 85 40        sta $40      ; the track-number read lands here

:1
c687: bd 8c c0     lda $c08c,x
c68a: 10 fb        bpl :1
c68c: 2a           rol          ; carry is always set before & after
c68d: 85 3c        sta $3c

:2
c68f: bd 8c c0     lda $c08c,x
c692: 10 fb        bpl :2
c694: 25 3c        and $3c      ; decode the 4&4 byte
c696: 88           dey
c697: d0 ec        bne ReadAddr1
c699: 28           plp
c69a: c5 3d        cmp $3d
c69c: d0 be        bne ReadAddrProlog   ; try again if sector wrong
c69e: a5 40        lda $40      ; is track correct?
c6a0: c5 41        cmp $41
c6a2: d0 b8        bne ReadAddrProlog
c6a4: b0 b7        bcs ReadDataProlog

; 86 + 256 + 1= 343 bytes
;
;

ReadSectorData
c6a6: a0 56        ldy #$56     ; carry is set, A==0 upon entry

readSectorA
c6a8: 84 3c        sty $3c

:1
c6aa: bc 8c c0     ldy $c08c,x
c6ad: 10 fb        bpl :1
c6af: 59 d6 02     eor $02d6,y  ; translate 6&2 nibble
c6b2: a4 3c        ldy $3c
c6b4: 88           dey
c6b5: 99 00 03     sta $0300,y
c6b8: d0 ee        bne readSectorA

readSectorB
c6ba: 84 3c        sty $3c

:2
c6bc: bc 8c c0     ldy $c08c,x
c6bf: 10 fb        bpl :2
c6c1: 59 d6 02     eor $02d6,y  ; translate 6&2 nibble
c6c4: a4 3c        ldy $3c
c6c6: 91 26        sta ($26),y
c6c8: c8           iny
c6c9: d0 ef        bne readSectorB

:3
c6cb: bc 8c c0     ldy $c08c,x  ; read checksum
c6ce: 10 fb        bpl :3
c6d0: 59 d6 02     eor $02d6,y

goReadAddrProlog
c6d3: d0 87        bne ReadAddrProlog
c6d5: a0 00        ldy #$00

denibblize1
c6d7: a2 56        ldx #$56

denibblize2
c6d9: ca           dex
c6da: 30 fb        bmi denibblize1
c6dc: b1 26        lda ($26),y
c6de: 5e 00 03     lsr $0300,x
c6e1: 2a           rol
c6e2: 5e 00 03     lsr $0300,x
c6e5: 2a           rol
c6e6: 91 26        sta ($26),y
c6e8: c8           iny
c6e9: d0 ee        bne denibblize2

c6eb: e6 27        inc $27
c6ed: e6 3d        inc $3d
c6ef: a5 3d        lda $3d
c6f1: cd 00 08     cmp $0800
c6f4: a6 2b        ldx $2b
c6f6: 90 db        bcc goReadAddrProlog
c6f8: 4c 01 08     jmp $0801    ; start boot stage-2

c6fb: 00 00 00     db 0,0,0,0,0
c6fe: 00 00


--
 Jerry Penner    e-mail: remove blip and _