home *** CD-ROM | disk | FTP | other *** search
- ;---------------------------------------------------------------------
- ; ASM88 FILE: BLKSEND.A Send Control Data to Block
- ; ----------
- ; WRITTEN: 25/10/87
- ; -------
- ; PURPOSE: This is one of a series of files which take
- ; ------- advantage of INT 21H functions under MS-DOS.
- ; In each case the error situation is marked by
- ; the carry flag being set. We use the De Smet
- ; external variable '_carryf' to see whether the
- ; carry is set on return from the function.
- ; If so, the error code can be used to obtain
- ; information about the specific error.
- ;
- ; USAGE: unsigned BLKSEND(drv, buf, num, &_carryf)
- ; ----- int drv; A = 1, B = 2.....DEFAULT = 0
- ; char *buf;
- ; unsigned num; (number of bytes to send)
- ; char *_carryf;
- ;
- ; DEPENDENCIES: De Smet C V 2.44+
- ; ------------
- ; Copyright 1987 - Cogar Computer Services Pty. Ltd
- ;---------------------------------------------------------------------
-
- CSEG
- PUBLIC BLKSEND_
-
- BLKSEND_:
- push bp ; normal De Smet C start
- mov bp,sp ; point to the stack
- mov ax,ds ; and make ES common with DS
- mov es,ax
- ;----------------------------------------------------------------------
- ; The unique programme follows.
- ;----------------------------------------------------------------------
- mov byte bl,[bp+4] ; the drive code
- mov dx,[bp+6] ; address of buffer
- mov cx,[bp+8] ; number of bytes to send
- mov ah,44h ; the Function No.
- mov al,4
- int 21h
- jc BLKSEND_ERROR
- jmp BLKSEND_QUIT
- BLKSEND_ERROR:
- mov si,[bp+10] ; get address of '_carryf' variable
- mov byte [si],1 ; return with _carryf = 1
- ;----------------------------------------------------------------------
- ; Normal programme termination.
- ;----------------------------------------------------------------------
- BLKSEND_QUIT:
- pop bp ; restore starting conditions
- ret
- ;----------------------------------------------------------------------