home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / MNUM416D.SZH / FILEDIR.ASM < prev    next >
Assembly Source File  |  1990-03-08  |  3KB  |  122 lines

  1. ;
  2. ;                       Message Base Reply Chain Linker
  3. ;
  4. ;              This module was originally written by Bob Hartman
  5. ;                       Sysop of FidoNet node 1:132/101
  6. ;
  7. ;   Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
  8. ;
  9. ; This program source code is being released with the following provisions:
  10. ;
  11. ; 1.  You are  free to make  changes to this source  code for use on your own
  12. ; machine,  however,  altered source files may not be distributed without the 
  13. ; consent of Spark Software.
  14. ;
  15. ; 2.  You may distribute "patches"  or  "diff" files for any changes that you
  16. ; have made, provided that the "patch" or "diff" files are also sent to Spark
  17. ; Software for inclusion in future releases of the entire package.   A "diff"
  18. ; file for the source archives may also contain a compiled version,  provided
  19. ; it is  clearly marked as not  being created  from the original source code.
  20. ; No other  executable  versions may be  distributed without  the  consent of
  21. ; Spark Software.
  22. ;
  23. ; 3.  You are free to include portions of this source code in any program you
  24. ; develop, providing:  a) Credit is given to Spark Software for any code that
  25. ; may is used, and  b) The resulting program is free to anyone wanting to use
  26. ; it, including commercial and government users.
  27. ;
  28. ; 4.  There is  NO  technical support  available for dealing with this source
  29. ; code, or the accompanying executable files.  This source  code  is provided
  30. ; as is, with no warranty expressed or implied (I hate legalease).   In other
  31. ; words, if you don't know what to do with it,  don't use it,  and if you are
  32. ; brave enough to use it, you're on your own.
  33. ;
  34. ; Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
  35. ; on the public FidoNet network, or at the address given above.
  36. ;
  37.  
  38. .xlist
  39.         page    64,132
  40.         
  41.         title   FileDir
  42.         subttl  by Bob Hartman
  43.         
  44.         name    FileDir
  45.         ;
  46.         ;
  47.         ;
  48.         ; The following macro files come with the MicroSoft "C" compiler
  49.         ;
  50.         include version.inc
  51.         include msdos.inc
  52.         include cmacros.inc
  53.         
  54.         .sall
  55. .list
  56. ;
  57. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  58.  
  59. sBegin   data
  60.  
  61. fdir_buffer     DW 016H DUP (?)
  62.  
  63. sEnd
  64.  
  65. sBegin   code
  66.  
  67.         assumes  cs,code
  68.         assumes  ds,data
  69.                                 
  70.         EXTRN    _strcpy:NEAR
  71.  
  72. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  73.  
  74. cProc   filedir,<PUBLIC>
  75.  
  76.         parmDP  origname
  77.         parmW   times
  78.         parmDP  ret_str
  79.         parmW   mode
  80.  
  81. cBegin
  82.  
  83. ; First set up the DTA
  84.     mov    dx,OFFSET DGROUP:fdir_buffer
  85.     mov    ah,1ah
  86.     int    21h
  87.  
  88. ; Now set up for a find_first operation
  89.     sub    bx,bx
  90.     mov    cx,mode
  91.     mov    dx,origname
  92.     mov    ah,4eh
  93.  
  94. ; Is it supposed to be a find_next?
  95.     cmp    WORD PTR times,0
  96.     je    do_find_first
  97.     mov    ah,4fh
  98.  
  99. do_find_first:
  100.     int    21h
  101.     jnc    fd_no_err
  102.  
  103. ; If we had an error, return null strings
  104.     mov    BYTE PTR fdir_buffer+30,0
  105.     mov    BYTE PTR fdir_buffer+21,0
  106.  
  107. fd_no_err:
  108.  
  109. ; Now copy in the result
  110.     mov    ax,OFFSET DGROUP:fdir_buffer+30
  111.     push    ax
  112.     push    WORD PTR ret_str
  113.     call    _strcpy
  114.     add    sp,4
  115.     mov    al,BYTE PTR fdir_buffer+21
  116.     sub    ah,ah
  117.  
  118. cEnd
  119.  
  120. sEnd
  121.         end
  122.