; GETCCP ; This routine calculates the starting address of the CCP. If the memory-based ; ENV type is 80H or above, then the CCP address is taken from the ENV. If not, ; it is calculated from the BIOS warmboot vector. The result is returned in HL. ; No other registers are affected. public getccp extrn envptr getccp: push af push de ld hl,(envptr) ; Get ENV address ld de,08h ; Offset to type byte add hl,de ld a,(hl) rla ; High bit into carry flag jr nc,usebios ; If not set, calculate from warmboot address ld de,03fh-08h ; Additional offset to CCP address in ENV add hl,de ld e,(hl) inc hl ld d,(hl) ex de,hl ; CCP address in HL jr exit usebios: ld hl,(0001) ; Get BIOS warmboot entry point ld de,-1603h ; Offset to CCP add hl,de exit: pop de pop af ret end