1862
|
1 *******************************************************************
|
|
2 * Tsmon - Timesharing monitor
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
|
8 * ------------------------------------------------------------------
|
|
9 * 6 ????/??/??
|
|
10 * From Tandy OS-9 Level Two VR 02.00.01.
|
|
11
|
|
12 nam Tsmon
|
|
13 ttl Timesharing monitor
|
|
14
|
|
15 use defsfile.d
|
|
16
|
|
17 rev set $00
|
|
18 edition set 8
|
|
19
|
|
20 psect tsmon_a,Prgrm+Objct,ReEnt+rev,edition,200,start
|
|
21
|
|
22 vsect
|
|
23 childid rmb 1
|
|
24 parmptr rmb 2
|
|
25 parmlen rmb 2
|
|
26 inbuff rmb 128
|
|
27 endsect
|
|
28
|
|
29 Login fcc "LOGIN"
|
|
30 LoginPrm fcb C$CR
|
|
31
|
|
32 IcptRtn rti
|
|
33
|
|
34 start stx <parmptr,u save parameter pointer
|
|
35 std <parmlen,u save parameter length
|
|
36 leax IcptRtn,pcr point to intercept routine
|
|
37 os9 F$Icpt and set it
|
|
38 L0024 ldx <parmptr,u get pointer to parameter
|
|
39 ldd <parmlen,u and length
|
|
40 cmpd #$0002
|
|
41 bcs L0052
|
|
42 lda ,x get byte at command line
|
|
43 cmpa #C$CR cr?
|
|
44 beq L0052 if so, branch
|
|
45 clra stdin
|
|
46 os9 I$Close close it
|
|
47 lda #UPDAT.
|
|
48 os9 I$Open open device on command line
|
|
49 bcs Exit branch if error
|
|
50 inca A = 1
|
|
51 os9 I$Close close stdout
|
|
52 inca A = 2
|
|
53 os9 I$Close close stderr
|
|
54 clra stdin path
|
|
55 os9 I$Dup dup to stdout
|
|
56 bcs Exit branch if error
|
|
57 os9 I$Dup dup to stderr
|
|
58 bcs Exit branch if error
|
|
59 L0052 clra stdin
|
|
60 leax <inbuff,u point to buffer
|
|
61 ldy #$0001 read 1 byte
|
|
62 os9 I$ReadLn read line
|
|
63 bcs L0024 branch if error
|
|
64 lda #Objct object
|
|
65 clrb no additional mem
|
|
66 leax <Login,pcr point to login
|
|
67 leau <LoginPrm,pcr and to parameters
|
|
68 ldy #$0000 parameter size
|
|
69 os9 F$Fork fork program
|
|
70 bcs L0024 branch if error
|
|
71 sta <childid else save process ID of child
|
|
72 L0072 os9 F$Wait wait for it to finish
|
|
73 cmpa <childid same as PID we forked?
|
|
74 bne L0072 if not, wait more
|
|
75 bra L0024 else go back
|
|
76 Exit os9 F$Exit exit
|
|
77
|
|
78 endsect
|