improve comments regarding call PSP:5 patch

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1375 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Kenneth J Davis 2009-05-08 00:00:17 +00:00
parent 0d16215fef
commit d9e2861a44
2 changed files with 10 additions and 9 deletions

View File

@ -68,12 +68,10 @@ typedef struct {
BYTE ps_fill1; /* 04 single char fill=0 */
/* CP/M-like entry point */
/* offsets 5-9 are a far call to absolute address 0:000Ch
coded so that CP/M apps can do a near call to psp:5, does a
far call but ensures word at offset 6 is size of COM file
e.g. FEF0h by using 1MB wrap around address 0F01D:FEF0
(jmp code stored at 0:000C should be duplicated in HMA FFFF:00D0)
Note: MS-DOS has value as FEEE which wraps to 0:00BEh */
/* offsets 5-9 are a far call to absolute address 0:00C0h
encoded using 1MB wrap form of address (e.g. 0F01D:FEF0h)
for compatiblity with CP/M apps that do a near call to psp:5
and expect size (KB) of allocated segment in word at offset 6 */
UBYTE ps_farcall; /* 05 far call opcode */
VOID(FAR ASMCFUNC * ps_reentry) (void); /* 06 re-entry point */

View File

@ -68,9 +68,12 @@ segment HMA_TEXT
; For CP/M compatibility allow a program to invoke any DOS API function
; between 0 and 24h by doing a near call to psp:0005h which embeds a far call
; to absolute address 0:00C0h (int vector 30h & 31h) or FFFF:00D0 (hma).
; Note: int 31h is also used for DPMI
; Upon entry the stack has a near return offset (desired return address) and
; far return seg:offset (useless return to data at offset 0ah after far call
; 0:00C0h contains the jmp instruction to reloc_call_cpm_entry which should
; be duplicated in hma to ensure correct operation with either state of A20 line.
; Note: int 31h is also used for DPMI but only in protected mode.
; Upon entry the stack has a near return offset (desired return address offset)
; and far return seg:offset (desired return segment of PSP, and useless offset
; which if used will return to the data, not code, at offset 0ah after far call
; in psp). We convert it to a normal call and correct the stack to appear same
; as if invoked via an int 21h call including proper return address.
;