TITLE "Z3GPRT - Z3lib 4.0" ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from Z3GPRT.Z80 Ver 1.1 by Richard Conn ; Date : 30 Mar 89 ; Version : 1.2 ; Module : Z3GPRT ; Abstract: This module contains the routine GETPRT which returns ; the address of the current printer record. The choices ; have been reduces to only 2 printers to comply with the ; Extended ENV definition. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC GETPRT ; External References EXT ENVPTR .Z80 CSEG ;=============================================================== ; NAME - GETPRT ; Entry: - None ; Exit : HL - Address of printer record ; Uses : HL ; Special Requirements: None ;=============================================================== ; Printer record is structured as: ; ; defb ; defb ; defb ; defb
GETPRT: PUSH AF PUSH DE LD HL,(ENVPTR) ; Get Environment address LD DE,30H ; ..offset to Selection Byte ADD HL,DE LD A,(HL) ; Get selection byte AND 0001H ; ..insuring only PRT 0,1 used LD DE,7 ; Advance to first printer ADD HL,DE ADD A,A ; *2 (multiply by 4 to pt to selected printer) ADD A,A ; *4 LD E,A ; ..DE=offset ADD HL,DE ; HL pts to first byte of record POP DE ; ..restore regs POP AF RET END