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.
GetPSP
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* GetPSP - Gets address of Program Segment Prefix. For DOS 3.0 or higher.
;*
;* Shows:   DOS Function - 62h (Get PSP Address)
;*
;* Params:  None
;*
;* Return:  Short integer with PSP segment address
;*          or 0 if DOS version below 3.0
 
GetPSP  PROC
 
        INVOKE  GetVer                  ; Get DOS version number
        .IF     ax >= 300               ; If DOS 3.0 or higher:
        mov     ah, 62h                 ; Query DOS for PSP
        int     21h                     ; Get PSP Address
        mov     ax, bx                  ; Return in AX
        .ELSE                           ; Else 2.0:
        sub     ax, ax                  ; For version 2, return 0
        .ENDIF
        ret
 
GetPSP  ENDP
                                    -♦-