summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/CWAIT.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/MAPPER/CWAIT.ASM')
-rw-r--r--v4.0/src/MAPPER/CWAIT.ASM90
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;
2page 60,132
3;
4title 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
31buffer segment word public 'buffer'
32
33 extrn DosExecPgmCalled:word
34 extrn DosExecPgmReturnCode:word
35
36buffer ends
37
38dosxxx 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;
47str struc
48old_bp dw ?
49return dd ?
50Qprocessid dw ? ; Child process ID
51Aprocessid dd ? ; process id pointer
52resultcode dd ? ; result code pointer
53waitoption dw ? ; wait option
54actioncode dw ? ; action code
55str ends
56
57doscwait 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
70WeHaveExeced:
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
82ErrorExit:
83 Mexit ; pop registers
84 ret size str - 6 ; return
85
86doscwait endp
87
88dosxxx ends
89
90 end