annotate level1/cmds/tsmon.as @ 2787:28b6ec8a14d5 lwtools-port

Added 'extern' pragam, fixed up rules.mak, changed 'section text' to 'section code' in sources
author Boisy Pitre <boisy.pitre@nuance.com>
date Sun, 27 Jan 2013 07:54:07 -0600
parents 03f26e88b809
children 19517af71188
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
1 *******************************************************************
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
2 * Tsmon - Timesharing monitor
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
3 *
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
4 * $Id$
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
5 *
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
7 * Comment
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
9 * 6 ????/??/??
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
10 * From Tandy OS-9 Level Two VR 02.00.01.
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
11
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
12 nam Tsmon
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
13 ttl Timesharing monitor
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
14
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
15 use defsfile.d
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
16
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
17 rev set $00
1868
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
18 edition set 2
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
19
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 1869
diff changeset
20 section data
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
21 childid rmb 1
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
22 parmptr rmb 2
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
23 parmlen rmb 2
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
24 inbuff rmb 128
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
25 endsect
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
26
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 1869
diff changeset
27 * psect tsmon_a,Prgrm+Objct,ReEnt+rev,edition,200,start
2787
28b6ec8a14d5 Added 'extern' pragam, fixed up rules.mak, changed 'section text' to 'section code' in sources
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2783
diff changeset
28 section code
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 1869
diff changeset
29
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
30 Login fcc "LOGIN"
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
31 LoginPrm fcb C$CR
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
32
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
33 IcptRtn rti
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
34
1868
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
35 start stx parmptr save parameter pointer
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
36 std parmlen save parameter length
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
37 leax IcptRtn,pcr point to intercept routine
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
38 os9 F$Icpt and set it
1868
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
39 L0024 ldx parmptr get pointer to parameter
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
40 ldd parmlen and length
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
41 cmpd #$0002
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
42 bcs L0052
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
43 lda ,x get byte at command line
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
44 cmpa #C$CR cr?
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
45 beq L0052 if so, branch
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
46 clra stdin
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
47 os9 I$Close close it
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
48 lda #UPDAT.
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
49 os9 I$Open open device on command line
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
50 bcs Exit branch if error
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
51 inca A = 1
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
52 os9 I$Close close stdout
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
53 inca A = 2
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
54 os9 I$Close close stderr
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
55 clra stdin path
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
56 os9 I$Dup dup to stdout
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
57 bcs Exit branch if error
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
58 os9 I$Dup dup to stderr
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
59 bcs Exit branch if error
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
60 L0052 clra stdin
1868
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
61 leax inbuff point to buffer
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
62 ldy #$0001 read 1 byte
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
63 os9 I$ReadLn read line
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
64 bcs L0024 branch if error
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
65 lda #Objct object
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
66 clrb no additional mem
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
67 leax <Login,pcr point to login
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
68 leau <LoginPrm,pcr and to parameters
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
69 ldy #$0000 parameter size
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
70 os9 F$Fork fork program
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
71 bcs L0024 branch if error
1868
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
72 sta childid else save process ID of child
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
73 L0072 os9 F$Wait wait for it to finish
1868
cba8a54bc509 Slowly but surely
boisy
parents: 1862
diff changeset
74 cmpa childid same as PID we forked?
1862
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
75 bne L0072 if not, wait more
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
76 bra L0024 else go back
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
77 Exit os9 F$Exit exit
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
78
25d7f19ee2e8 To be tested later
boisy
parents:
diff changeset
79 endsect