Ðåôåðàò: Èíòðàíåò ñåòè
lds di,[bp+x+4] ; put the handle into the variable
mov [di],ax ; if there is no error and
xor ax,ax ; return a 0
xtndopx:pop ds
pop bp
ret 14
xtndopn endp
;--------------------------------
; Get or Set File Attributes(handle) func(67) (43H)
;
; var
; Func, Attribute, ErrCode : Integer;
; Filename : String[n];
;
;ErrCode := setattr(Func, Attribute, Filename);
;
begin setattr
push bp
mov bp,sp
push ds
lds si,[bp+x+8] ; put the subfunction in ax
mov ax,[si]
mov ah,043h ; put the function in ah
lds dx,[bp+x] ; ptr to var desc block for ASCIIZ string
inc dx ; add 1 to get the address of the string
lds si,[bp+x+4] ; put the attribute to set in cx
mov cx,[si]
int 21h
jc setattx ; carry set means failure
lds di,[bp+x+4] ; put the returned attributes in the
mov [di],cx ; variable if there is no error
xor ax,ax ; and return zero
setattx:mov ah,0
pop ds
pop bp
ret 14
setattr endp
;--------------------------------
; End of Job Flag Status func(187) (BBH)
;
; var
; Flag : Integer;
;
;ErrCode := eojstat(Flag);
;
begin eojstat
push bp
mov bp,sp
push ds
lds si,[bp+x] ; put the flag in ax
mov ax,[si]
mov ah,0BBh ; put the function in ah
int 21h
mov ah,0
lds di,[bp+x]
mov [di],ax
pop ds
pop bp
ret 6
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);
;
begin PRLH_Log
push bp
mov bp,sp
push ds
lds si,[bp+x+24] ; FileHandle
mov bx,[si]
lds si,[bp+x+20] ; ByteOffset
mov cx,[si]
lds si,[bp+x+16]
mov dx,[si]
lds si,[bp+x+4] ; AL = Log Flags
mov ax,[si]
lds si,[bp+x+12] ; LockLen
mov si,[si]
lds di,[bp+x+8]
mov di,[di]
lds bp,[bp+x] ; time out
mov bp,[bp]
mov ah,0BCH
int 21H
mov ah,0 ; clear the high byte of the return
pop ds
pop bp
ret 30
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);
begin PRLH_Rel
push bp
mov bp,sp
push ds
lds si,[bp+x+16] ; FileHandle
mov bx,[si]
lds si,[bp+x+12] ; HiByteOffset
mov cx,[si]
lds si,[bp+x+8] ; LoByte
mov dx,[si]
lds si,[bp+x+4] ; HiWordLen
mov si,[si]
lds di,[bp+x] ; LoWordLen
mov di,[di]
mov ah,0BDH
int 21H
mov ah,0
pop ds
pop bp
ret 22
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);
;
begin PRLH_Clr
push bp
mov bp,sp
push ds
lds si,[bp+x+16] ; FileHandle
mov bx,[si]
lds si,[bp+x+12] ; ByteOffset
mov cx,[si]
lds si,[bp+x+8]
mov dx,[si]
lds si,[bp+x+4] ; HiWordLen
mov si,[si]
lds di,[bp+x] ; LoWordLen
mov di,[di]
mov ah,0BEH
int 21H
mov ah,0
pop ds
pop bp
ret 22
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);
;
begin PRLF_Log
push bp
mov bp,sp
push ds
lds si,[bp+x+24] ; FCB
mov dx,[si]
lds si,[bp+x+20] ; ByteOffset
mov bx,[si]
lds si,[bp+x+16]
mov cx,[si]
lds si,[bp+x+4] ; AL = Log Flags
mov ax,[si]
lds si,[bp+x+8] ; low lock length
mov di,[si]
lds si,[bp+x+12] ; hi lock length
mov si,[si]
mov bp,[bp+x] ; timeout value
mov bp,[bp]
mov ah,0BFH
int 21H
mov ah,0
pop ds
pop bp
ret 28
PRLF_Log endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Rel Rec FCB C0H
;
; var
; ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
;
; ErrCode := PRLF_Rel(fcb,HiByteOffset,LoByteOffset);
;
begin PRLF_Rel
push bp
mov bp,sp
push ds
lds dx,[bp+x+8] ; FCB
lds si,[bp+x+4] ; ByteOffset
mov bx,[si]
lds si,[bp+x]
mov cx,[si]
mov ah,0C0H
int 21H
mov ah,0
pop ds
pop bp
ret 12
PRLF_Rel endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Physical Record Lock: Clr Rec FCB C1H
;
; var
; ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
;
; ErrCode := PRLF_clr(fcb,HiByteOffset,LoByteOffset);
;
begin PRLF_Clr
push bp
mov bp,sp
push ds
lds dx,[bp+x+8] ; FCB
lds si,[bp+x+4] ; ByteOffset
mov bx,[si]
lds si,[bp+x]
mov cx,[si]
mov ah,0C0H
int 21H
mov ah,0
pop ds
pop bp
ret 12
PRLF_Clr endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Lock Record Set C2H
;
; var
; ErrCode, Flags, TimeOut : Integer;
;
; ErrCode := PRLS_Lck(Flags,TimeOut);
;
begin PRLS_Lck
push bp
mov bp,sp
push ds
lds si,[bp+x+4] ; AL = Lock flag bits
mov ax,[si]
lds si,[bp+x] ; TimeOut Value
mov bp,[si]
mov ah,0C2h
int 21h
mov ah,0
pop ds
pop bp
ret 10
PRLS_Lck endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Release Record Set C3H
;
; var
; ErrCode : Integer;
;
; ErrCode := PRLS_Rel;
;
begin PRLS_Rel
mov ah,0C3h
int 21h
mov ah,0
ret
PRLS_Rel endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Clear Record Set C4H
;
; var
; ErrCode : Integer;
;
; errcode := PRLS_Clr;
;
begin PRLS_Clr
mov ah,0C4h
int 21h
mov ah,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);
;
begin OpenSem
push bp
mov bp,sp
push ds
lds dx,[bp+x+16] ; ptr to Semaphore string
; inc dx ; add 1 to get the address of the string
lds si,[bp+x+12] ; set semaphore value
mov cx,[si]
mov ax,0C500h ; set the function
int 21h
mov bh,00h
lds di,[bp+x] ; return the open count
mov [di],bx
lds di,[bp+x+4] ; return low handle
mov [di],cx
lds di,[bp+x+8] ; return high handle
mov [di],dx
mov ah,00h
pop ds
pop bp
ret 22
Ñòðàíèöû: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13