Program Segment Prefix

Program Segment Prefix

The Program Segment Prefix (PSP) is a data structure used in DOS systems to store the state of a program.It has the following structure:

The PSP is most often used to get the command line arguments of a DOS program, for example the command "foo.exe -a -f" executes foo.exe with the arguments '-a' and '-f'.

The segment address of the PSP can be determined by using interrupt 21 subfunction 62. This interrupt will return the PSP address in register BX. [ [http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte8fjk.htm INT 21,62 - Get PSP address (DOS 3 ] ]

Alternatively, in .COM programs, one can address the PSP directly just by using the offsets listed above. 00h points to the beginning of the PSP, FFh points to the end, etc. For example, the following code displays the command line arguments:

org 100h

; int 21h subfunction 9 requires '$' to terminate stringxor bx, bxmov bl, [80h] mov byte [81h+bx] , '$'

; print the stringmov ah, 9mov dx, 81hint 21h

; exitmov ax, 4C00hint 21h

References

External links

* [http://support.microsoft.com/kb/123729 Accessing Command Line Arguments] (microsoft.com)


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Program Segment Prefix — (рус. Префикс программного сегмента, PSP) структура данных, которая используется в операционных системах семейства DOS и CP/M для сохранения состояния компьютерных программ. PSP в DOS имеет следующую структуру: Offset (Смещение) Size (Размер)… …   Википедия

  • Program Segment Prefix — Als Programmsegmentpräfix (engl. Program Segment Prefix, PSP) bezeichnet man die ersten 256 Byte eines von MS DOS geladenen Programmes. Das PSP ist nicht in den ausführbaren Exe oder Com Dateien enthalten, sondern wird beim Laden des Programmes… …   Deutsch Wikipedia

  • Préfixe de Segment de Programme — Le Préfixe de Segment de Programme (Program Segment Prefix, ou PSP) est une structure de données utilisées par les systèmes DOS. Elle est construite pour chaque processus créé (.com ou .exe), et fait 256 octets de données spéciales. Pour les… …   Wikipédia en Français

  • Zero page (CP/M) — The Zero Page (or Base Page) is a data structure used in CP/M systems for programs to communicate with the operating system. In 8 bit CP/M versions it is located in the first 256 bytes of memory, hence its name.The equivalent structure in MS DOS… …   Wikipedia

  • Com-Datei — Eine Com Datei ist eine ausführbare Datei in CP/M, MS DOS und zu MS DOS kompatiblen Betriebssystemen. Der Name leitet sich aus der Dateinamenserweiterung „.com“ ab, die für das englische Wort command („Befehl“) steht. Viele Shell Werkzeuge wie… …   Deutsch Wikipedia

  • Psp — steht für: verschiedene Parteien Pacifistisch Socialistische Partij, eine ehemalige niederländische Partei Partido Socialista Puertorriqueño, eine ehemalige puerto ricanische Partei Partido Socialista del Perú, eine sozialistische Partei aus Peru …   Deutsch Wikipedia

  • PSP — comp. abbr. Paper Tape Space comp. abbr. Programmable Signal Processor engin. abbr. Planned Schedule Performance telecom. abbr. Planned Schedule Performance abbr. Personal Software Products (IBM) abbr. Program Segment Prefix (DOS) abbr.… …   United dictionary of abbreviations and acronyms

  • MS-DOS — This article is about Microsoft MS DOS. For other compatible operating systems of the DOS family, see DOS. MS DOS An example of MS DOS s command line interface, this one showing that the current directory is the root of drive C …   Wikipedia

  • Windows 95 — Part of the Microsoft Windows family …   Wikipedia

  • SoftRAM — Infobox Software name = SoftRAM and SoftRAM95 caption = Packaging claimed that SoftRAM could double your memory developer = Syncronys latest release version = 1995 latest release date = August 1995 operating system = Microsoft Windows genre =… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”