home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / VP2_409E.SZH / LOWLVL2.ASM < prev    next >
Assembly Source File  |  1989-06-06  |  4KB  |  198 lines

  1. ;
  2. ;  $Header: LOWLEVEL.ASM 3.3 87/12/12 00:47:46 Bob Exp $
  3. ;
  4. ;                           The Conference Mail System
  5. ;
  6. ;               This module was originally written by Bob Hartman
  7. ;                        Sysop of FidoNet node 1:132/101
  8. ;
  9. ;    Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
  10. ;
  11. ; The Conference Mail System  is a    complete Echomail processing package.  It
  12. ; is a superset of the original  Echomail utilities created by Jeff Rush, and
  13. ; also contains ideas gleaned from the    ARCmail,  Renum,  oMMM, MGM, and Opus
  14. ; programs that were created by various software authors.
  15. ;
  16. ; This program source code is being released with the following provisions:
  17. ;
  18. ; 1.  You are  free to make  changes to this source  code for use on your own
  19. ; machine,    however,  altered source files may not be distributed without the
  20. ; consent of Spark Software.
  21. ;
  22. ; 2.  You may distribute "patches"  or  "diff" files for any changes that you
  23. ; have made, provided that the "patch" or "diff" files are also sent to Spark
  24. ; Software for inclusion in future releases of the entire package.     A "diff"
  25. ; file for the source archives may also contain a compiled version,  provided
  26. ; it is  clearly marked as not    being created  from the original source code.
  27. ; No other    executable    versions may be  distributed without  the  consent of
  28. ; Spark Software.
  29. ;
  30. ; 3.  You are free to include portions of this source code in any program you
  31. ; develop, providing:  a) Credit is given to Spark Software for any code that
  32. ; may is used, and    b) The resulting program is free to anyone wanting to use
  33. ; it, including commercial and government users.
  34. ;
  35. ; 4.  There is    NO    technical support  available for dealing with this source
  36. ; code, or the accompanying executable files.  This source    code  is provided
  37. ; as is, with no warranty expressed or implied (I hate legalease).     In other
  38. ; words, if you don't know what to do with it,  don't use it,  and if you are
  39. ; brave enough to use it, you're on your own.
  40. ;
  41. ; Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
  42. ; on the public FidoNet network, or at the address given above.
  43. ;
  44. ; To use this code you will need Microsoft C version 4.0, and also Microsoft
  45. ; Macro Assembler version 4.0.
  46. ;
  47.  
  48. ;
  49. ;
  50. ;    $Log:    LOWLEVEL.ASM $
  51. ; Revision 3.3    87/12/12  00:47:46    Bob
  52. ; Source code release
  53. ;
  54. ;
  55.  
  56. ; This modules looks really strange because it was originally created
  57. ; from a mixed C/ASM listing and converted over to straight ASM for speed.
  58. ;
  59.  
  60.  
  61. .xlist
  62.         page    64,132
  63.  
  64.         title    LowLevel
  65.         subttl    by Bob Hartman
  66.  
  67.         name    LowLevel
  68.         ;
  69.         ;
  70.         ;
  71.         ; The following macro files come with the MicroSoft "C" compiler
  72.         ;
  73.         include version.inc
  74.         include msdos.inc
  75.         include cmacros.inc
  76.  
  77.         .sall
  78. .list
  79. ;
  80. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  81.  
  82. sBegin     code
  83.  
  84.         assumes  cs,code
  85.         assumes  ds,data
  86.  
  87. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  88.  
  89. cProc    mem1cpy,<PUBLIC>,<es,si,di>
  90.  
  91.         parmD    dest
  92.         parmDP    src
  93.         parmW    len
  94.  
  95. cBegin
  96.  
  97.         mov     cx,len
  98.  
  99. if sizeD
  100.         push    ds
  101.         lds     si,src
  102. else
  103.         mov     si,src
  104. endif
  105.  
  106.         les     di,dest
  107.         rep     movsb
  108.  
  109. if sizeD
  110.         pop     ds
  111. endif
  112.  
  113. cEnd
  114.  
  115. cProc    mem2cpy,<PUBLIC>,<ds,si,di>
  116.  
  117.         parmDP     dest
  118.         parmD    src
  119.         parmW    len
  120.  
  121. cBegin
  122.  
  123.         mov     cx,len
  124.         lds     si,src
  125.  
  126. if sizeD
  127.         push    es
  128.         les     di,dest
  129. else
  130.         mov     di,dest
  131. endif
  132.         rep     movsb
  133.  
  134. if sizeD
  135.         pop     es
  136. endif
  137.  
  138. cEnd
  139.  
  140. cProc    mem1set,<PUBLIC>,<es,si,di>
  141.  
  142.         parmD    dest
  143.         parmW    val
  144.         parmW    len
  145.  
  146. cBegin
  147.  
  148.         mov     cx,len
  149.         mov     ax,val
  150.         les     di,dest
  151.         rep     stosb
  152.  
  153. cEnd
  154.  
  155. cProc    match_byte,<PUBLIC>,<di>
  156.  
  157.         parmDP    str
  158.         parmW    mbyte
  159.         parmW    len
  160.  
  161. cBegin
  162.  
  163. if sizeD
  164.         push    ds
  165.         push    es
  166.         les     di,str
  167.         mov     ax,es
  168.         mov     ds,ax
  169.         mov     dx,ds
  170. else
  171.         mov     di,str
  172. endif
  173.  
  174.         mov     ax,mbyte
  175.         mov     cx,len
  176.         repne    scasb
  177.         dec     di
  178.         cmp     BYTE PTR [di],al
  179.         mov     ax,di
  180.         je        get_out
  181.  
  182. if sizeD
  183.         mov     dx,0
  184. endif
  185.  
  186.         mov     ax,0
  187. get_out:
  188.  
  189. if sizeD
  190.         pop     es
  191.         pop     ds
  192. endif
  193.  
  194. cEnd
  195.  
  196. sEnd
  197.         end
  198.