TITLE "Z3GETCCP - Z3lib 4.0" ;---------------------------------------------------------------; ; Author : Unknown. Contributed by Jay Sage, ; minor mod by Harold F. Bower ; Date : 1988 ; Version : 1.1 ; Module : Z3GETCCP ; Abstract: This module contains the routine GETCCP which 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 ; resulting address is returned in the HL register. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC GETCCP ; External References EXT ENVPTR ; Definitions WBOOT EQU 0 ; Location of BIOS Warmboot vector OSLEN EQU 1600H ; Length of CCP+BDOS .Z80 CSEG ;=============================================================== ; NAME - GETCCP ; Entry: - None ; Exit : HL = Calculated address for start of CCP ; Uses : HL ; Special Requirements : Module relys on 2K CCP and 3.5K BDOS ;=============================================================== GETCCP: PUSH AF PUSH DE ; Save regs LD HL,(ENVPTR) ; Get ENV address LD DE,08H ; ..and offset to type byte ADD HL,DE BIT 7,(HL) ; Is Bit 7 high for extended ENV? JR Z,USEBIO ; ..jump if normal system LD DE,3FH-8 ; Have extended, so add additional offset ADD HL,DE LD E,(HL) ; ..and get the CCP address INC HL LD D,(HL) EX DE,HL ; Put it in HL JR EXIT ; ..and exit USEBIO: LD HL,(WBOOT+1) ; Get BIOS warmboot entry point LD DE,-OSLEN-3 ; Offset to CCP ADD HL,DE ; ..and calculate EXIT: POP DE POP AF RET END