Интранет сети
Информация - Радиоэлектроника
Другие материалы по предмету Радиоэлектроника
>;
; var
;Mode, Handle, RetCode : Integer;
;Filename : String[n];
;
; RetCode := xtndopn(Mode, Handle, Filename);
;
beginxtndopn
pushbp
movbp,sp
pushds
ldssi,[bp+x+8] ; put the mode in ax
movax,[si]
movah,03Dh ; put the function in ah
ldsdx,[bp+x] ; ptr to ASCIIZ string
incdx ; add 1 to get to the beginning of the string
int21h
jcxtndopx; carry set means failure
ldsdi,[bp+x+4] ; put the handle into the variable
mov[di],ax ; if there is no error and
xorax,ax ; return a 0
xtndopx:popds
popbp
ret14
xtndopn endp
;--------------------------------
; Get or Set File Attributes(handle) func(67) (43H)
;
; var
;Func, Attribute, ErrCode : Integer;
;Filename : String[n];
;
;ErrCode := setattr(Func, Attribute, Filename);
;
beginsetattr
pushbp
movbp,sp
pushds
ldssi,[bp+x+8] ; put the subfunction in ax
movax,[si]
movah,043h ; put the function in ah
ldsdx,[bp+x] ; ptr to var desc block for ASCIIZ string
incdx ; add 1 to get the address of the string
ldssi,[bp+x+4] ; put the attribute to set in cx
movcx,[si]
int21h
jcsetattx; carry set means failure
ldsdi,[bp+x+4] ; put the returned attributes in the
mov[di],cx ; variable if there is no error
xorax,ax ; and return zero
setattx:movah,0
popds
popbp
ret14
setattr endp
;--------------------------------
; End of Job Flag Status func(187) (BBH)
;
; var
;Flag : Integer;
;
;ErrCode := eojstat(Flag);
;
begineojstat
pushbp
movbp,sp
pushds
ldssi,[bp+x] ; put the flag in ax
movax,[si]
movah,0BBh ; put the function in ah
int21h
movah,0
ldsdi,[bp+x]
mov[di],ax
popds
popbp
ret6
eojstat endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Log Record BCH
;
; var
;ErrCode,FileHandle,HiByteOffset,LoByteOffset : Integer
;HiLockLen,LoLockLen,Flags,TimeOut : Integer
;
;ErrCode := PRLH_Log(FileHandle,HiByteOffset,LoByteOffset,HiLockLen,
; LoLockLen,Flags,TimeOut);
;
beginPRLH_Log
pushbp
movbp,sp
pushds
ldssi,[bp+x+24]; FileHandle
movbx,[si]
ldssi,[bp+x+20]; ByteOffset
movcx,[si]
ldssi,[bp+x+16]
movdx,[si]
ldssi,[bp+x+4]; AL = Log Flags
movax,[si]
ldssi,[bp+x+12]; LockLen
movsi,[si]
ldsdi,[bp+x+8]
movdi,[di]
ldsbp,[bp+x]; time out
movbp,[bp]
movah,0BCH
int21H
movah,0 ; clear the high byte of the return
popds
popbp
ret30
PRLH_Log endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Release Rec BDH
;
; var
;FileHandle,HiByteOffset,LoByteOffset,ErrCode,
; HiWordLen,LoWordLen : integer;
; ErrCode := PRLH_Rel(FileHandle,HiByteOffset,LoByteOffset,HiWordLen,
; LoWordLen:integer);
beginPRLH_Rel
pushbp
movbp,sp
pushds
ldssi,[bp+x+16] ; FileHandle
movbx,[si]
ldssi,[bp+x+12] ; HiByteOffset
movcx,[si]
ldssi,[bp+x+8] ; LoByte
movdx,[si]
ldssi,[bp+x+4] ; HiWordLen
movsi,[si]
ldsdi,[bp+x] ; LoWordLen
movdi,[di]
movah,0BDH
int21H
movah,0
popds
popbp
ret22
PRLH_Rel endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Release Clr BEH
;
; var
; FileHandle,HiByteOffset,LoByteOffset,ErrCode,
; HiWordLen,LoWordLen : integer;
; ErrCode := PRLH_Rel(FileHandle,HiByteOffset,LoByteOffset,HiWordLen,
; LoWordLen:integer);
;
beginPRLH_Clr
pushbp
movbp,sp
pushds
ldssi,[bp+x+16]; FileHandle
movbx,[si]
ldssi,[bp+x+12]; ByteOffset
movcx,[si]
ldssi,[bp+x+8]
movdx,[si]
ldssi,[bp+x+4]; HiWordLen
movsi,[si]
ldsdi,[bp+x]; LoWordLen
movdi,[di]
movah,0BEH
int21H
movah,0
popds
popbp
ret22
PRLH_Clr endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Log Rec FCB BFH
;
; var
;ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
;HiLockLen,LoLockLen,Flags,TimeOut : Integer;
;
; ErrCode := PRLF_Log(fcb,HiByteOffset,LoByteOffset,HiLockLen,LoLockLen,Flags,TimeOut);
;
beginPRLF_Log
pushbp
movbp,sp
pushds
ldssi,[bp+x+24]; FCB
movdx,[si]
ldssi,[bp+x+20]; ByteOffset
movbx,[si]
ldssi,[bp+x+16]
movcx,[si]
ldssi,[bp+x+4]; AL = Log Flags
movax,[si]
ldssi,[bp+x+8]; low lock length
movdi,[si]
ldssi,[bp+x+12]; hi lock length
movsi,[si]
movbp,[bp+x]; timeout value
movbp,[bp]
movah,0BFH
int21H
movah,0
popds
popbp
ret28
PRLF_Log endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Rel Rec FCB C0H
;
; var
;ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
;
; ErrCode := PRLF_Rel(fcb,HiByteOffset,LoByteOffset);
;
beginPRLF_Rel
pushbp
movbp,sp
pushds
ldsdx,[bp+x+8]; FCB
ldssi,[bp+x+4]; ByteOffset
movbx,[si]
ldssi,[bp+x]
movcx,[si]
movah,0C0H
int21H
movah,0
popds
popbp
ret12
PRLF_Rel endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Clr Rec FCB C1H
;
; var
;ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
;
; ErrCode := PRLF_clr(fcb,HiByteOffset,LoByteOffset);
;
beginPRLF_Clr
pushbp
movbp,sp
pushds
ldsdx,[bp+x+8]; FCB
ldssi,[bp+x+4]; ByteOffset
movbx,[si]
ldssi,[bp+x]
movcx,[si]
movah,0C0H
int21H
movah,0
popds
popbp
ret12
PRLF_Clr endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Lock Record Set C2H
;
; var
;ErrCode, Flags, TimeOut : Integer;
;
; ErrCode := PRLS_Lck(Flags,TimeOut);
;
beginPRLS_Lck
pushbp
movbp,sp
pushds
ldssi,[bp+x+4]; AL = Lock flag bits
movax,[si]
ldssi,[bp+x]; TimeOut Value
movbp,[si]
movah,0C2h
int21h
movah,0
popds
popbp
ret10
PRLS_Lck endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Release Record Set C3H
;
; var
;ErrCode : Integer;
;
; ErrCode := PRLS_Rel;
;
beginPRLS_Rel
movah,0C3h
int21h
movah,0
ret
PRLS_Rel endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Clear Record Set C4H
;
; var
;ErrCode : Integer;
;
; errcode := PRLS_Clr;
;
beginPRLS_Clr
movah,0C4h
int21h
movah,0
ret
PRLS_Clr endp
;--------------------------------
; Semaphores func(197) (C5H) subfunction 00h
;
; var
;RetCode,SemaValu,HiHandle,LoHandle,OpenCnt : Integer;
;Sema4 : String[n];
;
; RetCode := OpenSem(Sema4,SemaValu,HiHandle,LoHandle,OpenCnt);
;
beginOpenSem
pushbp
movbp,sp
pushds
ldsdx,[bp+x+16]; ptr to Semaphore string
;incdx ; add 1 to get the address of the string
ldssi,[bp+x+12]; set semaphore value
movcx,[si]
movax,0C500h; set the function
int21h
movbh,00h
ldsdi,[bp+x]; return the open count
mov[di],bx
ldsdi,[bp+x+4] ; return low handle
mov[di],cx
ldsdi,[bp+x+8]; return high handle
mov[di],dx
movah,00h
popds
popbp
ret22
OpenSem endp
;--------------------------------
; Semaphores func(197) (C5H) subfunction 01h
;
; var
;RetCode,HiHandle,LoHandle,SemaValu,OpenCnt : Integer;
;
; RetCode := ExamSem(HiHandle,LoHandle,SemaValu,OpenCnt);
;
beginExamSem
pushbp
movbp,sp
pushds
ldssi,[bp+x+12]; hi handle
movdx,[si]
ldssi,[bp+x+8]; lo handle
mov