Disk Transfer Area (DTA)
For all file reads and writes performed using FCB function calls, as well as for "Find First" and "Find Next" calls using FCBs or not, DOS uses a memory buffer called Disk Transfer Area, which is by default located at offset 80h in the PSP and is 128 bytes long (this area is also used by the command tail), so in order not to interfere with whichever command line parameters there might be, the Disk Transfer Address should be set to a different location in memory. This is done like this:
--8<--------------------------------------------------------------------------- Set_DTA:
mov ah, 1Ah
lea dx, [bp+offset DTA]
int 21h
---------------------------------------------------------------------------8<--
;Interrupt: 21h
;Function: 1Ah - Set Disk Transfer Address (DTA)
;On entry: AH - 1Ah
; DS:DX - Address of DTA
;Returns: Nothing
Of course that before passing control back to the host you should restore the Disk Transfer Address back to its original value:
--8<--------------------------------------------------------------------------- Restore_DTA:
mov ah, 1Ah
mov dx, 80h
int 21h
---------------------------------------------------------------------------8<--
A sufficient buffer area should always be reserved, as DOS will detect and abort any disk transfers that would fall off the end of the current segment or wrap around within the segment.
No comments:
Post a Comment
do u hav any doubts just mail us.our team will find the solution for it and we will clarify it as soon.
regards;
S-TECHNOLOGIES team