; TITLE "ATZ3G0 - Z3LIB 4.0" NAME ('@GET01') ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Date : 23 Jul 89 ; Version : 1.2 ; Module : ATZ3G0 ; Abstract: This module contains the routines @GET0 and @GET1 ; which are elements of common code extracted from several ; modules in Z3LIB. They retrieve the byte at a specified ; offset value. @GET0 calculates the offset from the value ; stored in the ENVPTR global variable, while @GET1 assumes ; both the base and offset are already loaded. They are ; consolidated here for greater efficiency ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC @GET0, @GET1 ; External References EXT ENVPTR .Z80 CSEG ;=============================================================== ; NAME - @GET0 ; Entry: DE - Contains offset from starting value in ENVPTR ; Exit : AF - Contains byte at ENVPTR offset. Flags set ; Uses : AF ; Special Requirements: Assumes that DE and HL have been ; previously saved ; NOTE: If ENVPTR=0 for invalid Environment, the byte at locn ; 0000H (usually 0C3H) is returned. ;=============================================================== @GET0: LD HL,(ENVPTR) ; Load ENVPTR starting address LD A,H OR L ; Is it a valid address? JR Z,GET2 ; ..jump if not, else.. ; ..and fall thru ;=============================================================== ; NAME - @GET1 ; Entry: DE - Contains offset from starting value in ENVPTR ; HL - Contains base address ; Exit : AF - Contains byte at ENVPTR offset. Flags set ; Uses : AF ; Special Requirements: Assumes that DE and HL have been ; previously saved ;=============================================================== @GET1: ADD HL,DE ; Add base and offset GET2: LD A,(HL) ; Get addressed byte POP DE ; Restore previously saved regs POP HL OR A ; Set flags on retrieved byte RET ; ..and return to caller END