]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/WRITE.ASM
3 title CP
/DOS DosWrite mapper
5 dosxxx
segment byte public 'dos'
6 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
8 ;**********************************************************************
12 ;* FUNCTION: Write a specified number of bytes to a file
16 ;* push word file handle
17 ;* push@ other buffer area
18 ;* push word buffer length
19 ;* push@ word bytes written
22 ;* MODULES CALLED: PC-DOS Int 21h, ah=40h, write
24 ;*********************************************************************
35 Written dd ?
; number of bytes actually written
36 Bufflng dw ?
; number of bytes to be written
37 Buffer dd ?
; write buffer address
38 Handle dw ?
; file handle
43 Enter doswrite
; push registers
45 mov bx,[bp].handle
; get handle
46 lds dx,[bp].buffer
; set write buffer
47 mov cx,[bp].bufflng
; number of bytes to be written
49 mov ah,40h
; load opcode
50 int 21h
; write bytes to the file
51 jc exit
; jump if error
53 lds si,[bp].written
; pointer to return data
54 mov word ptr [si],ax ; save actual number of bytes written
55 sub ax,ax ; set good return code
57 exit: mexit
; pop registers
58 ret size
str - 6 ; return