home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
167
/
FILLDISK.ZIP
/
DFILL.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-10-10
|
1KB
|
64 lines
PAGE 57,132
TITLE D F I L L . A S M (SUBROUTINE TO FILLDISK.SRC)
;
; DFILL CREATE, WRITE AND CLOSE FILE VIA INT 33, FUNCTIONS 60, 64 AND 62
;
; IN PARM 1, STACK FILE NAME (inclusive drive letter)
; PARM 2, " BLOCK 512 BYTES (already filled)
; PARM 3, " NUMBER OF SECTORS (to be written)
PARM STRUC
SAVEBP DW 0
RETOFF DW 0
RETSEG DW 0
PARM3 DW 0
PARM2 DW 0
PARM1 DW 0
PARM ENDS
PARMSIZE EQU OFFSET PARM1 - OFFSET RETSEG
CODE SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:CODE
DFILL PROC FAR
PUBLIC DFILL
PUSH BP ; SET UP BP FOR PARM ADDRESSING
MOV BP, SP
MOV BX, [BP].PARM1 ; GET PTR(DFNAME$)
MOV DX, [BX+2]
; MOV AH, 9 ; TEST FOR STRING TRANSFER OK
; INT 33
MOV CX, 0 ; FILE ATTRIBUTE
MOV AH, 60 ; DOS FUNCTION CREATE FILE
INT 33 ; ------------------------
MOV BX, AX ; SAVE FILE HANDLE
MOV SI, [BP].PARM2 ; GET BLOCK$
MOV DX, [SI+2]
MOV SI, [BP].PARM3 ; GET RECORDS%
MOV DI, [SI]
LOOP: MOV CX, 512 ; BLOCK LENGTH
MOV AH, 64 ; DOS FUNCTION WRITE FILE
INT 33 ; -----------------------
DEC DI ; RECORDS%
JNZ LOOP
MOV AH, 62 ; DOS FUNCTION CLOSE FILE
INT 33 ; -----------------------
POP BP
RET PARMSIZE
DFILL ENDP
CODE ENDS
END