home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn5f02h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  2.1 KB  |  43 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;    Function 5FH Subfunction 02H:                           ;
  4.         ;                  Get Assign-List Entry                     ;
  5.         ;                                                            ;
  6.         ;    int get_alist_entry(index,                              ;
  7.         ;           plocalname,premotename,                          ;
  8.         ;           puservalue,ptype)                                ;
  9.         ;        int  index;                                         ;
  10.         ;        char *plocalname;                                   ;
  11.         ;        char *premotename;                                  ;
  12.         ;        int  *puservalue;                                   ;
  13.         ;        int  *ptype;                                        ;
  14.         ;                                                            ;
  15.         ;    Returns 0 if the requested assign-list entry is found,  ;
  16.         ;    otherwise returns error code.                           ;
  17.         ;                                                            ;
  18.         ;************************************************************;
  19.  
  20. cProc   get_alist_entry,PUBLIC,<ds,si,di>
  21. parmW   index
  22. parmDP  plocalname
  23. parmDP  premotename
  24. parmDP  puservalue
  25. parmDP  ptype
  26. cBegin
  27.         mov     bx,index        ; Get list index.
  28.         loadDP  ds,si,plocalname  ; DS:SI = pointer to local name
  29.                                   ; buffer.
  30.         loadDP  es,di,premotename ; ES:DI = pointer to remote name
  31.                                   ; buffer.
  32.         mov     ax,5f02h        ; Set function code.
  33.         int     21h             ; Get assign-list entry.
  34.         jb      ga_err          ; Exit on error.
  35.         xor     ax,ax           ; Else return 0.
  36.         loadDP  ds,si,puservalue ; Get address of uservalue.
  37.         mov     [si],cx         ; Store user value.
  38.         loadDP  ds,si,ptype     ; Get address of type.
  39.         mov     bh,0
  40.         mov     [si],bx         ; Store device type to type.
  41. ga_err:
  42. cEnd
  43.