ZZRCC Bootstrap ROM

This is the listing of the small bootstrap ROM inside of EPM7032S CPLD


;12/18/20
;32-byte ROM inside CPLD
;check for CF disk not busy, then read the master boot record to 0xB080
;  execute the program starting from 0xB080
CFdata       equ 010h        ;CF data register
CFerr        equ 011h        ;CF error reg
CFsectcnt         equ 012h        ;CF sector count reg
CF07         equ 013h       ;CF LA0-7
CF815        equ 014h           ;CF LA8-15
CF1623       equ 015h           ;CF LA16-23
CF2427       equ 016h           ;CF LA24-27
CFstat       equ 017h           ;CF status/command reg

    org 0
    ld c,8        ;point to I/O page register
    ld l,0        ;CF is in page 0
    db 0edh,6eh    ;op code for LDCTL (C),HL

; check for disk not busy
readbsy:
    in a,(CFstat)    ; read CF status
    rla
    jr c,readbsy
; do not need to set up sector/track and sector count because
;  they are set by default after reset
;    out (CF1623),a    ; track 0
;    out (CF815),a
;    inc a        ;master boot sector is sector 1
;    out (CF07),a    ;read master boot sector (sector 1)
;    ld c,CFdata    ; reg C points to CF data reg
;    out (CFsectcnt),a    ; write to sector count with 1

    ld a,20h        ; read sector command
    out (CFstat),a    ; issue the read sector command
chkdrq:
    in a,(CFstat)    ; check data request bit set before write CF data
    and 8        ; bit 3 is DRQ, wait for it to set
    jr z,chkdrq

    ld c,CFdata
    ld hl,0b080h      ;copy program to 0xB080
    ld b,l
    inir        ;z80 read 128 bytes
    jp 0b080h
builderpages/plasmo/zzrcc/cpldrom.txt · Last modified: 2020/12/18 08:43 by plasmo
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0