Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GetDTA
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* GetDTA - Gets address of current Disk Transfer Area.
;*
;* Shows:   DOS Function - 2Fh (Get DTA Address)
;*
;* Params:  Dta - Far pointer to receive transfer address
;*
;* Return:  None
 
GetDTA  PROC,
        Dta:FPBYTE
 
        mov     ah, 2Fh                 ; DOS Function 2Fh
        int     21h                     ; Get DTA Address in ES:BX
        mov     ax, es                  ; Save DTA segment
        mov     dx, bx                  ; Save DTA offset
        les     bx, Dta                 ; Now ES:BX points to variable
        mov     es:[bx], dx             ; Copy DTA address to
        mov     es:[bx+2], ax           ;       dta variable
        ret
 
GetDTA  ENDP
                                    -♦-