Outils pour utilisateurs

Outils du site


back2root:ibm-pc-ms-dos:interrupts:int_21:int_21_4b

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
back2root:ibm-pc-ms-dos:interrupts:int_21:int_21_4b [2023/01/10 11:55] – supprimée - modification externe (Unknown date) 127.0.0.1back2root:ibm-pc-ms-dos:interrupts:int_21:int_21_4b [2023/01/16 17:54] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +====== INT 0x21 - 0x4b - DOS 2+ - "EXEC" - Load and/or Execute Program ======
 +
 +===== Request/Call: =====
 +
 +{{tablelayout?rowsHeaderSource=Auto&colwidth=""}}
 +^  reg  ^  value  ^  descr  ^
 +|  AH    0x4b           |
 +|  AL       | type of load|
 +|  DS:DX  |   | ASCIIz program name (must include extentsion)  |
 +|  ES:BX  |   | parameter block (see below)  |
 +
 +==== Structures format ====
 +
 +== Format of EXEC parameter block for AL=00h,01h,04h: ==
 +{{tablelayout?rowsHeaderSource=Auto}}
 +^  Offset  ^  Size   ^ Description                                                                            ^
 +|  0x00    |  WORD   | segment of environment to copy for child process (copy caller's environment if 0000h)  |
 +|  0x02    |  DWORD  | pointer to command tail to be copied into child's [[back2root:ibm-pc-ms-dos:hardware:informations:program_segment_prefix|PSP]]                                  |
 +|  0x06    |  DWORD  | pointer to first [[back2root:ibm-pc-ms-dos:hardware:informations:file_control_block|FCB]] to be copied into child's [[back2root:ibm-pc-ms-dos:hardware:informations:program_segment_prefix|PSP]]                                     |
 +|  0x0A    |  DWORD  | pointer to second [[back2root:ibm-pc-ms-dos:hardware:informations:file_control_block|FCB]] to be copied into child's [[back2root:ibm-pc-ms-dos:hardware:informations:program_segment_prefix|PSP]]                                    |
 +|  0x0E    |  DWORD  | (AL=01h) will hold subprogram's initial SS:SP on return                                |
 +|  0x12    |  DWORD  | (AL=01h) will hold entry point (CS:IP) on return                                       |
 +
 +== Format of EXEC parameter block for AL=03h: ==
 +{{tablelayout?rowsHeaderSource=Auto}}
 +^  Offset  ^  Size  ^ Description                                              ^
 +|  0x00    |  WORD  | segment at which to load overlay                         |
 +|  0x02    |  WORD  | relocation factor to apply to overlay if in .EXE format  |
 +
 +===== Return: =====
 +**CL cleared if successfull**
 +
 +  * BX, DX are destroyed
 +  * if sub function 0x01 is called, process ID set to new program's [[back2root:ibm-pc-ms-dos:hardware:informations:program_segment_prefix|PSP]] can be requested via [[back2root:ibm-pc-ms-dos:interrupts:int_21:int_21_62|Int 0x21, 0x62]]
 +
 +**CL is set on error**
 +
 +  * AX =  error code (0x01, 0x02, 0x05, 0x08, 0x0a, 0x0b) see [[back2root:ibm-pc-ms-dos:interrupts:int_21:int_21_59|Int 0x21, 0x59]], [[back2root:ibm-pc-ms-dos:hardware:informations:dos_error_code|DOS error Code]]
 +
 +
 +===== Notes & Comments =====
 +
 +<WRAP round box>
 +  * DOS 2.x destroys all registers, including SS:SP
 +  * for function 00h and 01h, the calling process must ensure that there is enough unallocated memory available; if necessary, by releasing memory with AH=49h or AH=4Ah
 +  * for function 01h, the value to be passed to the child program is put on top of the child's stack
 +  * for function 03h, DOS assumes that the overlay is being loaded into memory allocated by the caller
 +  * function 01h has been documented for DOS 5+, but was undocumented in prior versions
 +
 +  * some versions (such as DR-DOS 6.0) check the parameters and parameter block and return an error if an invalid value (such as an offset of FFFFh) is found
 +</WRAP>
 +
 +<WRAP round important>
 +BUG: DOS 2.00 assumes that DS points at the current program's [[back2root:ibm-pc-ms-dos:hardware:informations:program_segment_prefix|PSP]]
 +</WRAP>
 + 
 +[[start|Back]]