Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Program Segment Prefix
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== References == {{reflist|refs= <ref name="R1">{{cite web |url=http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte8fjk.htm |title=INT 21h,62h - Get PSP address (DOS 3.x) |url-status=dead |archive-url=https://web.archive.org/web/20120207062050/http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte8fjk.htm |archive-date=2012-02-07}}</ref> <ref name="Taylor_1982_Translators">{{cite magazine |title=Upward migration - Part 1: Translators - Using translation programs to move CP/M-86 programs to CP/M and MS-DOS<!-- this is the actual but faulty title --> |trans-title=<!-- this is how it should have been titled -->Using translation programs to move CP/M programs to CP/M-86 and MS-DOS |author-first1=Roger |author-last1=Taylor |author-first2=Phil |author-last2=Lemmons |date=June 1982 |magazine=[[BYTE]] |issn=0360-5280 |id={{CODEN|BYTEDJ}} |volume=7 |number=6 |publisher=[[BYTE Publications Inc.]] |pages=321β322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344 [342, 344] |url=https://tech-insider.org/personal-computers/research/acrobat/8206-b.pdf |access-date=2020-01-15 |url-status=live |archive-url=https://web.archive.org/web/20200116024623/https://tech-insider.org/personal-computers/research/acrobat/8206-b.pdf |archive-date=2020-01-16 |quote=[β¦] Gaining Access to [[CP/M-86]] [β¦] Gaining access to CP/M-86 requires placing the function code in the CL register, placing the byte parameter in the DL register or placing the word parameter in the DX register, placing the data segment in the DS register (the data segment is usually not changed for a converted program), and executing a software interrupt, [[INT E0h|INT #224]]. The result is returned in the AL register if it is a byte value; if the result is a word value, it is returned in both the AX and BX registers. Double-word values are returned with the offset in the BX registers and the segment in the ES register. Conversion of programs from [[CP/M-80]] to CP/M-86, then, requires replacing the call to location 5 with the software interrupt INT #224. Another necessary change involves the [[warm boot]]. Under CP/M-80, the warm boot may be accessed by a system call with a function code of 0 for a jump to location 0. CP/M-86, however, does not support the jump to location 0. As a result, you must change this program exit in the translated program if the program is to run correctly. Provided that the call to location 5 is replaced with INT #224, that the warm boot change is made, and that the registers are mapped correctly, there should be little problem in getting the translated program to access the CP/M-86 system functions. [β¦] Gaining Access to [[MS-DOS]] [β¦] Although MS-DOS has a "preferred" mechanism through a soft-ware interrupt, [[INT 21h|INT #33]], for accessing the system, an additional mechanism is provided for "preexisting" programs that is compatible with CP/M-80 calling conventions, at least for functions in the range of 0-36. As far as system calls within the allowed function range are concerned, the programmer doesn't have to do anything to translated programs to get them to run under MS-DOS other than to correctly map the registers. MS-DOS also supports the warm boot function of CP/M-80. A jump to location 0 under MS-DOS executes a software interrupt, [[INT 20h|INT #32]], which is functionally a program end and the normal way to exit from a program. [β¦]}} [https://archive.org/details/byte-magazine-1982-06] [https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0323.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0324.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0326.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0328.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0330.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0332.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0334.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0336.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0338.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0340.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0342.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0344.pdf][https://www.americanradiohistory.com/hd2/IDX-Consumer/Archive-Byte-IDX/IDX/80s/82-83/Byte-1982-06-OCR-Page-0346.pdf] (13 pages)</ref> <ref name="Schulman_1994_Undocumented-DOS">{{cite book |author-first1=Andrew |author-last1=Schulman |author-first2=Ralf D. |author-last2=Brown |author-link2=Ralf D. Brown |author-first3=David |author-last3=Maxey |author-first4=Raymond J. |author-last4=Michels |author-first5=Jim |author-last5=Kyle |title=Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and Windows 3.1 |publisher=[[Addison Wesley]] |edition=2 |date=1994 |orig-year=November 1993<!-- first printing --> |isbn=0-201-63287-X |location=Reading, Massachusetts, USA |url-access=registration |url=https://archive.org/details/undocumenteddosp00andr_0}} (xviii+856+vi pages, 3.5"-floppy) Errata: [https://web.archive.org/web/20190417215556/http://www.cs.cmu.edu/afs/cs/user/ralf/pub/books/UndocumentedDOS/errata.ud2][https://web.archive.org/web/20190417212906/https://www.pcjs.org/pubs/pc/programming/Undocumented_DOS/#errata-2nd-edition]</ref> <ref name="Necasek_2011_CALL5">{{cite web |title=Who needs the address wraparound, anyway? |date=2011-09-13 |author-first=Michal |author-last=Necasek |work=OS/2 Museum |url=http://www.os2museum.com/wp/who-needs-the-address-wraparound-anyway/ |access-date=2020-02-19 |url-status=live |archive-url=https://web.archive.org/web/20200219004644/http://www.os2museum.com/wp/who-needs-the-address-wraparound-anyway/ |archive-date=2020-02-19 |quote=[β¦] [[86-DOS]], and hence [[PC DOS]]/[[MS-DOS]], used a clever trick. The byte at offset 5 of the PSP contained a far call opcode (9Ah); the word at offset 6 of the PSP contained the appropriate value to indicate program segment size, and also the offset part of the far call. The word at offset 8, which served as the segment part of the far call, was crafted such that when combined with the offset, it would wrap around (a well understood feature of the [[8086]] CPU) and point to address 0:C0h, which contains interrupt vector 30h. [β¦] the [[CALL 5 (DOS)|CALL 5]] interface works even in DOS emulation under Windows NT and OS/2, and those systems most certainly cannot run with the [[A20 line]] disabled. How does that work then? [β¦] Rather than chopping off address bits, the system mirrors the five bytes at 0:C0h at 1000C0h. The same technique had been in fact used in DOS 5 and above running with [[DOS (CONFIG.SYS directive)|DOS=HIGH]]. In that case, DOS makes sure that linear address 1000C0h contains the appropriate far call. [β¦]}}</ref> <ref name="Paul_1997_MSDOS">{{cite book |title=MSDOSTIPs — Tips fΓΌr den Umgang mit MS-DOS 5.0-7 |work=MPDOSTIP |author-first=Matthias R. |author-last=Paul |date=1997-07-01 |orig-year=1994-01-01 |language=de |url=http://www.antonis.de/dos/dos-tuts/mpdostip/html/msdostip.htm |access-date=2013-10-25 |url-status=live |archive-url=https://web.archive.org/web/20170822214030/http://www.antonis.de/dos/dos-tuts/mpdostip/html/msdostip.htm |archive-date=2017-08-22}} (NB. MSDOSTIP.TXT is part of MPDOSTIP.ZIP, maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the MSDOSTIP.TXT file.) [https://web.archive.org/web/20190601152204/https://www.sac.sk/download/text/mpdostip.zip<!-- A yet older version 155 from 1997-05-13 of the 1997-07-15 distribution archive. -->]</ref> <ref name="Paul_1997_4DOSTIP">{{cite web |title=Hinweise zu JPSofts 4DOS 5.5b/c, 5.51, 5.52a und NDOS |work=MPDOSTIP |author-first=Matthias R. |author-last=Paul |date=1997-05-01 |orig-year=1995-03-01 |language=de |url=http://www.antonis.de/dos/dos-tuts/mpdostip/html/4dostip.htm |access-date=2015-05-08 |url-status=live |archive-url=https://web.archive.org/web/20161104211143/http://www.antonis.de/dos/dos-tuts/mpdostip/html/4dostip.htm |archive-date=2016-11-04}} (NB. The provided link points to a HTML-converted version of the <code>4DOS5TIP.TXT</code> file, which is part of the <code>MPDOSTIP.ZIP</code><!-- still named TIPS_MP.ZIP between 1991 and 1996-11 --> collection.) [https://web.archive.org/web/20190601152204/https://www.sac.sk/download/text/mpdostip.zip<!-- A yet older version 155 from 1997-05-13 of the 1997-07-15 distribution archive. -->]</ref> <ref name="Paul_2002_COM">{{cite newsgroup |title=Re: Run a COM file |author-first=Matthias R. |author-last=Paul |date=2002-10-07 |orig-date=2000 |newsgroup=alt.msdos.programmer |url=https://groups.google.com/d/msg/alt.msdos.programmer/d7blJjY0H5M/Qu3VeTOIGVcJ |access-date=2017-09-03 |url-status=live |archive-url=https://archive.today/20170903230312/https://groups.google.com/forum/%23!msg/alt.msdos.programmer/d7blJjY0H5M/Qu3VeTOIGVcJ |archive-date=2017-09-03}} [https://groups.google.com/d/msg/alt.lang.asm/PNOd9zfYow0/vXbab16j4XwJ] (NB. Has details on DOS COM program calling conventions.)</ref> }}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)