diff options
Diffstat (limited to 'v4.0/src/MAPPER/CWAIT.ASM')
| -rw-r--r-- | v4.0/src/MAPPER/CWAIT.ASM | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/CWAIT.ASM b/v4.0/src/MAPPER/CWAIT.ASM new file mode 100644 index 0000000..ed4a444 --- /dev/null +++ b/v4.0/src/MAPPER/CWAIT.ASM | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | ; | ||
| 2 | page 60,132 | ||
| 3 | ; | ||
| 4 | title CP/DOS DOSCWait mapper | ||
| 5 | |||
| 6 | ; ************************************************************************* * | ||
| 7 | ; * | ||
| 8 | ; * MODULE: DosCWait | ||
| 9 | ; * | ||
| 10 | ; * ACTION: Wait for a child termination | ||
| 11 | ; * | ||
| 12 | ; * CALLING SEQUENCE: | ||
| 13 | ; * | ||
| 14 | ; * push actioncode ; execution options | ||
| 15 | ; * push waitoption ; wait options | ||
| 16 | ; * push@ resultcode ; address to put result code | ||
| 17 | ; * push@ processidword ; address to put process id | ||
| 18 | ; * push processid ; process id of process to wait for | ||
| 19 | ; * call doscwait | ||
| 20 | ; * | ||
| 21 | ; * RETURN SEQUENCE: | ||
| 22 | ; * | ||
| 23 | ; * | ||
| 24 | ; * | ||
| 25 | ; * MODULES CALLED: None | ||
| 26 | ; * | ||
| 27 | ; * | ||
| 28 | ; * | ||
| 29 | ; ************************************************************************* | ||
| 30 | |||
| 31 | buffer segment word public 'buffer' | ||
| 32 | |||
| 33 | extrn DosExecPgmCalled:word | ||
| 34 | extrn DosExecPgmReturnCode:word | ||
| 35 | |||
| 36 | buffer ends | ||
| 37 | |||
| 38 | dosxxx segment byte public 'dos' | ||
| 39 | assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing | ||
| 40 | |||
| 41 | public doscwait | ||
| 42 | .sall | ||
| 43 | .xlist | ||
| 44 | include macros.inc | ||
| 45 | .list | ||
| 46 | ; | ||
| 47 | str struc | ||
| 48 | old_bp dw ? | ||
| 49 | return dd ? | ||
| 50 | Qprocessid dw ? ; Child process ID | ||
| 51 | Aprocessid dd ? ; process id pointer | ||
| 52 | resultcode dd ? ; result code pointer | ||
| 53 | waitoption dw ? ; wait option | ||
| 54 | actioncode dw ? ; action code | ||
| 55 | str ends | ||
| 56 | |||
| 57 | doscwait proc far | ||
| 58 | Enter doscwait ; push registers | ||
| 59 | |||
| 60 | mov ax,seg buffer | ||
| 61 | mov ds,ax ; set temporary buffer | ||
| 62 | assume ds:buffer | ||
| 63 | |||
| 64 | cmp DosExecPgmCalled,0 ; ?????? | ||
| 65 | jz WeHaveExeced | ||
| 66 | |||
| 67 | mov ax,31 | ||
| 68 | jmp ErrorExit ; error exit | ||
| 69 | |||
| 70 | WeHaveExeced: | ||
| 71 | mov ax,DosExecPgmReturnCode | ||
| 72 | lds si,[bp].ResultCode | ||
| 73 | assume ds:nothing | ||
| 74 | mov ds:[si],ax ; return termination code | ||
| 75 | |||
| 76 | mov ax,[bp].Qprocessid ; return child process id | ||
| 77 | lds si,[bp].Aprocessid | ||
| 78 | mov ds:[si],ax | ||
| 79 | |||
| 80 | xor ax,ax ; set good return code | ||
| 81 | |||
| 82 | ErrorExit: | ||
| 83 | Mexit ; pop registers | ||
| 84 | ret size str - 6 ; return | ||
| 85 | |||
| 86 | doscwait endp | ||
| 87 | |||
| 88 | dosxxx ends | ||
| 89 | |||
| 90 | end | ||