DOS Fn 62H: Query Current PSP
Compatibility: 3.0+ (doc'd: 5.0)
Expects: AH 52H
──────────────────────────────────────────────────────────────────
Returns: BX PID▲ (Process ID) of current process
──────────────────────────────────────────────────────────────────
Info: This function obtains the segment address of the PSP (a.k.a, the
Process ID) of the currently-executing (most-recently started)
program.
A TSR should save its own PSP during initialization. Then,
before popping up, the TSR should use this fn to get the ID of
the interrupted program, then use fn 50H to set the PID to its
own (saved) value. Be sure to change the PID back before popping
down.
Notes: ■ On program startup, DS and ES both contain the PSP segment.
■ MS-DOS documents claim you can use this fn interchangeably with
fn 51H.
See Also: PSP (Program Segment Prefix)
Process Control Functions
Program Startup & Exit
DOS Environment
DOS Functions
-♦-