Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month! Interrupts & Ports - <b>create psp (int 21h, 26h)</b> [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
        Create PSP (INT 21h, 26h)

          AH = 26h
          DX = Segment number to set up PSP at
          Current PSP is copied to specified segment.

        Note: Use of this call should be avoided, now that DOS contains
              the EXEC function call.

        Format of PSP:
                Offset  Size    Description
                 00h  2 BYTEs   program exit point
                 02h    WORD    memory size in paragraphs
                 04h    BYTE    unused
                 05h  5 BYTEs   CP/M entry point
                 0Ah    DWORD   terminate address (old INT 22h)
                 0Eh    DWORD   break address (old INT 23h)
                 12h    DWORD   critical error handler (old INT 24h)
                 16h    WORD    parent PSP segment
                 18h 20 BYTEs   DOS 2+ open file table, FFh = unused
                 2Ch    WORD    DOS 2+ environment segment (see below)
                 2Eh    DWORD   DOS 2+ process's SS:SP on entry to last
                                INT 21 call
                 32h    WORD    DOS 3+ max open files
                 34h    DWORD   DOS 3+ open file table address
                 38h    DWORD   DOS 3+ pointer to previous PSP???
                                (set to FFFFFFFFh in 3.1,3.3)
                 3Ch 20 BYTEs   unused by DOS versions <= 3.3
                 50h  3 BYTEs   DOS function dispatcher (FAR routine) --
                                CDh 21h CBh
                 53h  9 BYTEs   unused
                 5Ch 16 BYTEs   FCB #1 (see AH=0Fh), filled in from first
                                commandline argument
                                (when opened, overwrites following FCB)
                 6Ch 20 BYTEs   FCB #2 (see AH=0Fh), filled in from second
                                commandline argument
                                (when opened, overwrites part of command tail)
                 80h 128 BYTEs  command tail / default DTA buffer
                                command tail is BYTE for length of tail,
                                N BYTEs for the tail, followed by a BYTE
                                containing 0Dh

        Format of environment block:
                Offset  Size    Description
                 00h  N BYTEs   first environment variable, ASCIZ string of
                                form "var=value"
                      N BYTEs   second environment variable, ASCIZ string
                      N BYTEs   last environment variable, ASCIZ string of
                                form "var=value"
                        BYTE    00h
                ---DOS 3+---
                        WORD    number of strings following environment
                                (normally 1)
                      N BYTEs   ASCIZ full pathname of program owning this

                                other strings may follow

See Also: INT 21h, 4Bh

Online resources provided by: --- NG 2 HTML conversion by Dave Pearson