TITLE "Z3GMSG - Z3lib 4.0" ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from Z3GMSG.Z80 Ver 1.1 by Richard Conn ; Date : 30 Jun 91 ; Version : 1.3 ; Module : Z3GMSG ; Abstract: This module contains the routine GETMSG which ; returns the address of the ZCPR3 message buffer. It also ; contains the entry point @GET3 which is used by GETECP. ; Revision: ; 1.2 - 21 Jan 88 - first release ; 1.3 - 30 Jun 91 - Return Error if No ENV. HFB ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC GETMSG, @GET3 ; External References EXT ENVPTR .Z80 CSEG ;=============================================================== ; NAME - GETMSG ; Entry: - None ; Exit : HL - Points to ZCPR3 message buffer if present ; A <> 0 and Zero Flag Reset (NZ) if OK ; A = 0 and Zero Flag Set (Z) if Error/Not Present ; Uses AF,HL ; Special Requirements: None ;=============================================================== GETMSG: PUSH DE ; Save DE LD DE,22H ; Offset to MSG Entry @GET3: LD HL,(ENVPTR) ; Point to the Environment LD A,H OR L ; Do we have an Env? JR Z,GETX ; ..Exit w/Error flag if not ADD HL,DE LD A,(HL) ; Get address in HL INC HL LD H,(HL) LD L,A OR H ; Set Z flag if HL = 0 GETX: POP DE ; Restore DE RET END