home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / DISKC.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  2KB  |  57 lines

  1.     page    66,132
  2. ;******************************** DISKC.ASM  *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. ;----------------------------------------------------------------------------
  13.     extrn    strlen2:far
  14.     extrn    lib_info:byte
  15.     extrn    buffer_searchc:far
  16. comment 
  17. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(  DISK   )
  18. GET_PATH - search enviornment for start of path information string
  19. ;
  20. ; inputs:    nothing
  21. ; output:     ES:DI = pointer to "PATH=" portion of path string.
  22. ;                CX = length of path
  23. ;
  24. ; note:  The path string consists of "PATH=" followed by path entries.
  25. ;        Each path entry is separated with ";" and the last one is
  26. ;        followed by a null character (00h).  ES:DI points at
  27. ;        the start of "PATH=".                 
  28. ;* * * * * * * * * * * * * *
  29. 
  30. path_string     db      'PATH=',0
  31.  
  32.     public    GET_PATH
  33. GET_PATH    PROC    FAR
  34.     mov    es,lib_info.psp_seg
  35.     apush    ax,ds
  36.     mov    es,word ptr es:[2ch]    ;get enviornment seg
  37.     mov    di,0
  38.  
  39.     push    cs
  40.     pop    ds
  41.     mov    si,offset path_string
  42.             
  43.     mov    cx,-1
  44.     call    buffer_searchc        ;scan for path, sets DI if found
  45.     push    es
  46.     pop    ds
  47.     call    strlen2            ;find string length -> cx       
  48.     apop    ds,ax
  49.     retf
  50. GET_PATH    ENDP
  51.  
  52. ;------------------------------------------------------------------------
  53.  
  54. LIBSEG    ENDS
  55.     end
  56.