Program Segment Prefix

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 vom Betriebssystem erstellt. Die erste Hälfte des PSPs beinhaltet verschiedene Informationen für das Betriebssystem, insbesondere zur Handhabung mehrerer (nacheinander) ausgeführter Programme. In der zweiten Hälfte befindet sich die Kommandozeile (command tail, ohne den eigentlichen Name des Programmes).

Struktur

Offset (hexadezimal)
00 – 01 Interrupt-20h–Befehl zum Beenden des Programms nach einem Sprung zur Adresse 0000h
02 – 03 Segmentadresse des ersten vom Programm nicht mehr belegten Speichers
05 – 09 Code um Interrupt 21h bei einem NEAR CALL zur Adresse 0005h auszuführen
0A – 0D Kopie des Interrupt-Vektors 22h, Rückkehradresse nach Beenden des Programms
0E – 11 Kopie des Interrupt-Vektors 23h, Interrupt für Strg-C
12 – 15 Kopie des Interrupt-Vektors 24h, Interrupt für fatale Fehler
16 - 17 Segment des Parent-PSPs: das Programm, das dieses Programm ausgeführt hat
18 - 2B Standardmäßige Job File Table (JFT), enthält je eine Dateitabellen-Nummer (System File Table, SFT) für bis zu 20 Datei-Handles
2C – 2D Segment des Umgebungsvariablen-Blocks (Environment) für dieses Programm
2E - 31 Adresse des Stapelspeichers (Stack) beim letzten Ausführen des Interrupts 21h
32 - 33 Nummer aller Datei-Handles in der JFT, standardmäßig 20
34 - 37 Adresse der aktuellen JFT, standardmäßig Offset 0018h in diesem PSP
50 – 52 Code um Interrupt 21h bei einem FAR CALL zur Adresse 0050h auszuführen
5C – 6B File Control Block (FCB) des ersten Parameters der Kommandozeile
6C – 7B FCB des zweiten Parameters
80      Längenangabe der Kommandozeile
81 – FF Kommandozeile mit allen Parametern, aber ohne den Kommandonamen selbst
80 - AB Bei Dateisuchoperationen von der standardmäßigen Disk Transfer Area (DTA) überschrieben

Weitere Bereiche des PSPs werden von Betriebssystem-Erweiterungen oder manchen TSR-Programmen genutzt.

Beispiel-Programm

Dieses Programm zeigt die Kommandozeile aus seinem PSP an: (Com-Datei, geschrieben in Assemblersprache)

org   100h

; Interrupt 21h, Funktion 09h benötigt ein Dollarzeichen als Endmarkierung
mov   bl, byte [0080h]
mov   bh, 00h
mov   byte [0081h+bx], '$'

; Ausgabe der Kommandozeile (bis zum ersten Dollarzeichen) mit Funktion 09h
mov   ah, 09h
mov   dx, 0081h
int   21h

; Beenden des Programmes mit Funktion 4Ch, Rückgabewert 00h
mov   ax, 4C00h
int   21h

Wikimedia Foundation.

Игры ⚽ Поможем написать реферат

Schlagen Sie auch in anderen Wörterbüchern nach:

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

  • 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 …   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”