]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/READ.ASM
3 title CP
/DOS DosRead mapper
* * *
5 dosxxx
segment byte public 'dos'
6 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
8 ;**********************************************************************
12 ;* FUNCTION: Read a specified number of bytes from the file
16 ;* push word file handle
17 ;* push@ other buffer area
18 ;* push word buffer length
19 ;* push@ word bytes read
22 ;* MODULES CALLED: PC-DOS Int 21h, ah=3fh,
24 ;*********************************************************************
35 Written dd ?
; number of bytes actually read
36 Bufflng dw ?
; number of bytes to be read
37 Buffer dd ?
; read buffer
42 Enter Dosread
; save registers
44 mov bx,[bp].handle
; fill registers for
45 lds dx,[bp].buffer
; function call
46 mov cx,[bp].bufflng
; number of bytes to read
48 mov ah,3fh
; load opcode
49 int 21h
; read from file
50 jc exit
; jump if error
52 lds si,[bp].written
; else, set return data area
53 mov word ptr [si],ax ; save number of bytes read
54 sub ax,ax ; set good return code
56 exit: mexit
; pop registers
57 ret size
str - 6 ; rturn