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

  1. ;
  2. ;                          Message Base Renumberer
  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   LowLevel
  42.         subttl  by Bob Hartman
  43.         
  44.         name    LowLevel
  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   code
  60.  
  61.         assumes  cs,code
  62.         assumes  ds,data
  63.                                 
  64. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  65.  
  66. cProc   fast_open,<PUBLIC>
  67.  
  68.         parmDP  fname
  69.         parmB   mode
  70.  
  71. cBegin
  72.  
  73. ; Set-up for the DOS open file call
  74.     mov    dx,fname
  75.     mov    al,mode
  76.         callos  open
  77.     jnc    fo_no_err
  78.  
  79.  
  80.     test    BYTE PTR mode,1
  81.     jne    fo_creat
  82.     test    BYTE PTR mode,2
  83.     je    fo_err
  84.  
  85. fo_creat:
  86.     mov    dx,fname
  87.     sub    cx,cx
  88.         callos  create
  89.     jnc    fo_no_err
  90.  
  91. fo_err:
  92.     mov    ax,-1
  93.  
  94. fo_no_err:
  95.  
  96. cEnd
  97.  
  98. cProc   fast_close,<PUBLIC>
  99.  
  100.         parmW   handle
  101.  
  102. cBegin
  103.  
  104.     mov    bx,handle
  105.         callos  close
  106.     jnc    fc_no_err 
  107.     mov    ax,-1
  108.     jmp    SHORT fc_out
  109.  
  110. fc_no_err:
  111.     sub    ax,ax
  112.  
  113. fc_out:
  114.  
  115. cEnd
  116.  
  117. cProc   fast_read,<PUBLIC>
  118.  
  119.         parmW   handle
  120.         parmDP  string
  121.         parmW   length
  122.  
  123. cBegin
  124.  
  125.     mov    bx,handle
  126.     mov    dx,string
  127.     mov    cx,length
  128.         callos  read
  129.     jnc    fr_no_err
  130.     mov    ax,-1
  131.  
  132. fr_no_err:
  133.  
  134. cEnd
  135.  
  136. cProc   fast_write,<PUBLIC>
  137.  
  138.         parmW   handle
  139.         parmDP  string
  140.         parmW   length
  141.  
  142. cBegin
  143.  
  144.     mov    bx,handle
  145.     mov    dx,string
  146.     mov    cx,length
  147.         callos  write
  148.     jnc    fw_no_err
  149.     mov    ax,-1
  150.  
  151. fw_no_err:
  152.  
  153. cEnd
  154.  
  155. cProc   fast_lseek,<PUBLIC>
  156.  
  157.         parmW   handle
  158.         parmW   offset1
  159.         parmW   offset2
  160.         parmW   where
  161.  
  162. cBegin
  163.  
  164.         mov     ax,where
  165.     mov    bx,handle
  166.     mov    dx,offset1
  167.     mov    cx,offset2
  168.         callos  lseek
  169.     jnc    fl_no_err
  170.     mov    ax,-1
  171.         mov     dx,-1
  172.  
  173. fl_no_err:
  174.  
  175. cEnd
  176.  
  177. cProc   rename,<PUBLIC>,<es,di>
  178.  
  179.         parmDP  oldname
  180.         parmDP  newname
  181.  
  182. cBegin
  183.  
  184.         mov     ax,ds
  185.         mov     es,ax
  186.         mov     dx,oldname
  187.         mov     di,newname
  188.         callos  rename
  189.         jc      ren_exit
  190.         xor     ax,ax
  191.  
  192. ren_exit:
  193.  
  194. cEnd
  195.  
  196. cProc   unlink,<PUBLIC>
  197.  
  198.         parmDP  fname
  199.  
  200. cBegin
  201.  
  202.         mov     dx,fname
  203.         callos  delete
  204.         jc      unl_exit
  205.         xor     ax,ax
  206.  
  207. unl_exit:
  208.  
  209. cEnd
  210.  
  211. cProc   match_byte,<PUBLIC>,<di>
  212.  
  213.         parmDP  string
  214.         parmW   matcher
  215.         parmW   length
  216.  
  217. cBegin
  218.         mov     di,string
  219.         mov     ax,matcher
  220.         mov     cx,length
  221.         repne   scasb
  222.         dec     di
  223.         cmp     BYTE PTR [di],al
  224.         mov     ax,di
  225.         je      get_out
  226.         mov     ax,0
  227. get_out:
  228.  
  229. cEnd
  230.  
  231. cProc   chdir,<PUBLIC>
  232.  
  233.         parmDP  dir
  234.  
  235. cBegin
  236.  
  237.     mov    dx,dir
  238.         callos  chdir
  239.     jc    c_exit
  240.     sub    ax,ax
  241. c_exit:
  242.  
  243. cEnd
  244.  
  245. cProc   change_disk,<PUBLIC>
  246.  
  247.         parmW   disknum
  248.  
  249. cBegin
  250.  
  251.     mov    dx,disknum
  252.         callos  selectdisk
  253.  
  254. cEnd
  255.  
  256. sEnd
  257.         end
  258.