home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
VP2SRC.ZIP
/
LOWLEVEL.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-06-06
|
7KB
|
468 lines
;
; $Header: LOWLEVEL.ASM 3.3 87/12/12 00:47:46 Bob Exp $
;
; The Conference Mail System
;
; This module was originally written by Bob Hartman
; Sysop of FidoNet node 1:132/101
;
; Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
;
; The Conference Mail System is a complete Echomail processing package. It
; is a superset of the original Echomail utilities created by Jeff Rush, and
; also contains ideas gleaned from the ARCmail, Renum, oMMM, MGM, and Opus
; programs that were created by various software authors.
;
; This program source code is being released with the following provisions:
;
; 1. You are free to make changes to this source code for use on your own
; machine, however, altered source files may not be distributed without the
; consent of Spark Software.
;
; 2. You may distribute "patches" or "diff" files for any changes that you
; have made, provided that the "patch" or "diff" files are also sent to Spark
; Software for inclusion in future releases of the entire package. A "diff"
; file for the source archives may also contain a compiled version, provided
; it is clearly marked as not being created from the original source code.
; No other executable versions may be distributed without the consent of
; Spark Software.
;
; 3. You are free to include portions of this source code in any program you
; develop, providing: a) Credit is given to Spark Software for any code that
; may is used, and b) The resulting program is free to anyone wanting to use
; it, including commercial and government users.
;
; 4. There is NO technical support available for dealing with this source
; code, or the accompanying executable files. This source code is provided
; as is, with no warranty expressed or implied (I hate legalease). In other
; words, if you don't know what to do with it, don't use it, and if you are
; brave enough to use it, you're on your own.
;
; Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
; on the public FidoNet network, or at the address given above.
;
; To use this code you will need Microsoft C version 4.0, and also Microsoft
; Macro Assembler version 4.0.
;
;
;
; $Log: LOWLEVEL.ASM $
; Revision 3.3 87/12/12 00:47:46 Bob
; Source code release
;
;
; This modules looks really strange because it was originally created
; from a mixed C/ASM listing and converted over to straight ASM for speed.
;
.xlist
page 64,132
title LowLevel
subttl by Bob Hartman
name LowLevel
;
;
;
; The following macro files come with the MicroSoft "C" compiler
;
include version.inc
include msdos.inc
include cmacros.inc
.sall
.list
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sBegin code
assumes cs,code
assumes ds,data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cProc fast_open,<PUBLIC>
parmDP fname
parmB mode
cBegin
; Set-up for the DOS open file call
if sizeD
push ds
lds dx,fname
else
mov dx,fname
endif
mov al,mode
callos open
jnc fo_no_err
test BYTE PTR mode,1
jne fo_creat
test BYTE PTR mode,2
je fo_err
fo_creat:
if sizeD
lds dx,fname
else
mov dx,fname
endif
sub cx,cx
callos create
jnc fo_no_err
fo_err:
mov ax,-1
fo_no_err:
if sizeD
pop ds
endif
cEnd
cProc ofast_close,<PUBLIC>
parmW handle
cBegin
mov bx,handle
callos close
jnc fc_no_err
mov ax,-1
jmp SHORT fc_out
fc_no_err:
sub ax,ax
fc_out:
cEnd
cProc ofast_read,<PUBLIC>
parmW handle
parmDP string
parmW len
cBegin
mov bx,handle
if sizeD
push ds
lds dx,string
else
mov dx,string
endif
mov cx,len
callos read
jnc fr_no_err
mov ax,-1
fr_no_err:
if sizeD
pop ds
endif
cEnd
cProc o1fast_read,<PUBLIC>,<ds>
parmW handle
parmD string
parmW len
cBegin
mov bx,handle
lds dx,string
mov cx,len
callos read
jnc fr1_no_err
mov ax,-1
fr1_no_err:
cEnd
cProc ofast_write,<PUBLIC>
parmW handle
parmDP string
parmW len
cBegin
mov bx,handle
if sizeD
push ds
lds dx,string
else
mov dx,string
endif
mov cx,len
callos write
jnc fw_no_err
mov ax,-1
fw_no_err:
if sizeD
pop ds
endif
cEnd
cProc o1fast_write,<PUBLIC>,<ds>
parmW handle
parmD string
parmW len
cBegin
mov bx,handle
lds dx,string
mov cx,len
callos write
jnc fw1_no_err
mov ax,-1
fw1_no_err:
cEnd
cProc ofast_lseek,<PUBLIC>
parmW handle
parmW offset1
parmW offset2
parmW where
cBegin
mov ax,where
mov bx,handle
mov dx,offset1
mov cx,offset2
callos lseek
jnc fl_no_err
mov ax,-1
mov dx,-1
fl_no_err:
cEnd
cProc mem1cpy,<PUBLIC>,<es,si,di>
parmD dest
parmDP src
parmW len
cBegin
mov cx,len
if sizeD
push ds
lds si,src
else
mov si,src
endif
les di,dest
rep movsb
if sizeD
pop ds
endif
cEnd
cProc mem2cpy,<PUBLIC>,<ds,si,di>
parmDP dest
parmD src
parmW len
cBegin
mov cx,len
lds si,src
if sizeD
push es
les di,dest
else
mov di,dest
endif
rep movsb
if sizeD
pop es
endif
cEnd
cProc mem1set,<PUBLIC>,<es,si,di>
parmD dest
parmW val
parmW len
cBegin
mov cx,len
mov ax,val
les di,dest
rep stosb
cEnd
cProc _fmalloc1,<PUBLIC>
parmW len
cBegin
mov ax,len
add ax,16
shr ax,1
shr ax,1
shr ax,1
shr ax,1
mov bx,ax
callos allocmem
jnc fmout
mov ax,0
mov dx,0
jmp short fmout1
fmout:
mov dx,ax
mov ax,0
fmout1:
cEnd
cProc _ffree1,<PUBLIC>,<es>
parmD str
cBegin
les ax,str
callos freemem
cEnd
cProc chdir,<PUBLIC>
parmDP dir
cBegin
if sizeD
push ds
lds dx,dir
else
mov dx,dir
endif
callos chdir
jc ch_err
xor ax,ax
ch_err:
if sizeD
pop ds
endif
cEnd
cProc match_byte,<PUBLIC>,<di>
parmDP str
parmW mbyte
parmW len
cBegin
if sizeD
push ds
push es
les di,str
mov ax,es
mov ds,ax
mov dx,ds
else
mov di,str
endif
mov ax,mbyte
mov cx,len
repne scasb
dec di
cmp BYTE PTR [di],al
mov ax,di
je get_out
if sizeD
mov dx,0
endif
mov ax,0
get_out:
if sizeD
pop es
pop ds
endif
cEnd
cProc go_directory,<PUBLIC>
parmDP dir
cBegin
cEnd
cProc change_disk,<PUBLIC>
parmW disk
cBegin
mov dx,disk
callos selectdisk
cEnd
sEnd
end