TITLE "Z33GBDOS - Z3lib 4.1" ;================================================================= ; Copyright (C) 1989 by Harold F. Bower. Permission granted to ; Alpha Systems Corp. to distribute with The Libraries, Version 4 ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Date : 28 Mar 89 ; Version : 1.0 ; Module : Z33GBDOS ; Abstract: This module contains the routine GETBDOS which returns ; the address of the base of the BDOS system segment. It ; senses an extended Environment, and uses the BDOS address ; stored there if so. Otherwise, it calculates the BDOS ; base address as 3.5k below the base of the BIOS jump table. ; The returned address is always on a page boundary if calcu- ; lated, but may be otherwise in an Extended Environment. ; Revisions: ;================================================================ ; Module Entry Points PUBLIC GETBDOS ; ..from Z3LIB Get.. EXT ENVPTR ; Definitions WBOOT EQU 0 ; BIOS Warm Boot Vector .Z80 CSEG ;=============================================================== ; NAME - GETBDOS ; Entry: - None ; Exit : HL = Base address of BDOS System Segment ; Uses : HL ; Special Requirements : None ;=============================================================== GETBDOS: PUSH DE ; Save regs PUSH AF LD HL,(ENVPTR) ; Get ENV address LD DE,8 ; ..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,42H-8 ; Have Extended ENV, so offset more ADD HL,DE LD E,(HL) ; ..and get the BDOS address INC HL LD D,(HL) EX DE,HL ; Put in HL for return JR EXIT ; ..and exit USEBIO: LD HL,(WBOOT+1) ; Get BIOS warmboot entry point LD DE,-0E03H ; Offset to BDOS ADD HL,DE ; ..and calculate EXIT: POP AF ; Restore regs POP DE RET END