diff options
Diffstat (limited to 'v4.0/src/MAPPER/EXIT.ASM')
| -rw-r--r-- | v4.0/src/MAPPER/EXIT.ASM | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/EXIT.ASM b/v4.0/src/MAPPER/EXIT.ASM new file mode 100644 index 0000000..5f98f70 --- /dev/null +++ b/v4.0/src/MAPPER/EXIT.ASM | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | ; | ||
| 2 | page 60,132 | ||
| 3 | ; | ||
| 4 | title CP/DOS DosExit mapper | ||
| 5 | ; | ||
| 6 | dosxxx segment byte public 'dos' | ||
| 7 | assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing | ||
| 8 | ; | ||
| 9 | ;********************************************************************** | ||
| 10 | ;* | ||
| 11 | ;* MODULE: dosexit | ||
| 12 | ;* | ||
| 13 | ;* FUNCTION: Exit a process | ||
| 14 | ;* | ||
| 15 | ;* CALLING SEQUENCE: | ||
| 16 | ;* | ||
| 17 | ;* push word action code | ||
| 18 | ;* push word result code | ||
| 19 | ;* call dosexit | ||
| 20 | ;* | ||
| 21 | ;* MODULES CALLED: DOS Int 21h, Function 4ch, terminate process | ||
| 22 | ;* | ||
| 23 | ;********************************************************************* | ||
| 24 | |||
| 25 | public dosexit | ||
| 26 | .sall | ||
| 27 | include macros.inc | ||
| 28 | |||
| 29 | str struc | ||
| 30 | old_bp dw ? | ||
| 31 | return dd ? | ||
| 32 | Result dw ? ; result code | ||
| 33 | Action dw ? ; action code | ||
| 34 | str ends | ||
| 35 | |||
| 36 | dosexit proc far | ||
| 37 | |||
| 38 | Enter DosExit ; push registers | ||
| 39 | |||
| 40 | mov ax,[bp].action ; set resule code area | ||
| 41 | cmp ax,1 ; check for valid action code | ||
| 42 | jg exit ; jump if invalid action code | ||
| 43 | |||
| 44 | mov ax,[bp].result ; else, set result code | ||
| 45 | |||
| 46 | mov ah,4ch ; load opcode | ||
| 47 | int 21h ; do exit | ||
| 48 | |||
| 49 | xor ax,ax ; set good return code | ||
| 50 | |||
| 51 | exit: mexit ; pop registers | ||
| 52 | ret size str - 6 ; return | ||
| 53 | |||
| 54 | dosexit endp | ||
| 55 | |||
| 56 | dosxxx ends | ||
| 57 | |||
| 58 | end | ||