home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / zsys / simtel20 / z3lib / zlib1.lbr / Z3GPATH.Z80 < prev    next >
Encoding:
Text File  |  1986-02-07  |  768 b   |  32 lines

  1. ;
  2. ; Z3LIB Module Name:  Z3GPATH
  3. ; Author:  Richard Conn
  4. ; Z3LIB  Version Number:  1.3
  5. ; Module Version Number:  1.1
  6. ;
  7.     public    getpath
  8.  
  9.     ext    envptr
  10.  
  11. ;
  12. ;    GETPATH returns the address of the external path in HL and the
  13. ; maximum number of elements in said path in A.  If there is no external path,
  14. ; A=0 and Zero Flag Set.  No other registers are affected.
  15. ;
  16. getpath:
  17.     push    de        ;save DE
  18.     ld    hl,(envptr)    ;pt to environment
  19.     ld    de,9        ;pt to path entry
  20.     add    hl,de
  21.     ld    e,(hl)        ;get path address in DE
  22.     inc    hl
  23.     ld    d,(hl)
  24.     inc    hl
  25.     ld    a,(hl)        ;get path size in A
  26.     ex    de,hl        ;HL pts to path
  27.     pop    de        ;restore DE
  28.     or    a        ;set flag
  29.     ret
  30.  
  31.     end
  32.