TITLE "ATZ3G2 - Z3LIB 4.0" NAME ('@GET2') ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Date : 23 Jul 89 ; Version : 1.3 ; Module : ATZ3G2 ; Abstract: This module contains the routine @GET2 which performs ; a 16-bit load from a memory location to the DE register ; pair, and loads the following byte from memory to the A reg. ; It is extracted from existing modules and is NOT intended ; for general-purpose use ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC @GET2 ; External References EXT ENVPTR .Z80 CSEG ;=============================================================== ; NAME - @GET2 ; Entry: DE - Contains the offset from ENVPTR base ; Exit : HL - Contains the word stored at the ENVPTR offset ; A - Contains the byte following the 16-bits at offset ; Uses : AF,HL ; Special Requirements: DE must have been saved by caller ;=============================================================== @GET2: LD HL,(ENVPTR) ; Get the beginning value LD A,H ; Test for Null ENV pointer OR L JR Z,GET2A ; ..jump to exit if No Pointer ADD HL,DE ; Add the offset LD E,(HL) ; Get the lower byte INC HL LD D,(HL) ; ..and high byte to position INC HL ; Bump pointer again LD A,(HL) ; Get the byte following pointer EX DE,HL ; Put pointer in HL OR A ; Set the flags GET2A: POP DE ; ..and restore old DE RET END