Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/procs.asm @ 1020:c1a5613ffe7b
changes
author | boisy |
---|---|
date | Thu, 06 Mar 2003 01:41:03 +0000 |
parents | c155aac72190 |
children | 84ea83668304 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
14 | 2 * Procs - Show processes |
0 | 3 * |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
185
diff
changeset
|
8 * 9 From Tandy OS-9 Level One VR 02.00.00 |
842 | 9 * 10 Now uses -e instead of e BGP 03/01/14 |
0 | 10 |
11 nam Procs | |
12 ttl program module | |
13 | |
14 | 14 * Disassembled 02/04/05 13:22:14 by Disasm v1.6 (C) 1988 by RML |
0 | 15 |
16 ifp1 | |
14 | 17 use defsfile |
0 | 18 endc |
14 | 19 |
0 | 20 tylg set Prgrm+Objct |
21 atrv set ReEnt+rev | |
22 rev set $01 | |
842 | 23 edition set 10 |
14 | 24 |
0 | 25 mod eom,name,tylg,atrv,start,size |
14 | 26 |
924 | 27 org 0 |
842 | 28 narrow rmb 1 |
29 eflag rmb 1 | |
30 aproc rmb 2 | |
31 wproc rmb 2 | |
32 sproc rmb 2 | |
33 myuid rmb 2 | |
14 | 34 u000A rmb 1 |
842 | 35 bufptr rmb 2 |
36 buffer rmb 87 | |
0 | 37 u0064 rmb 132 |
14 | 38 u00E8 rmb 2156 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
39 PsBuf rmb 450 |
0 | 40 size equ . |
14 | 41 |
42 name fcs /Procs/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
185
diff
changeset
|
43 fcb edition |
14 | 44 |
45 L0013 fcb C$LF | |
46 fcc "Usr # id pty sta mem pri mod" | |
47 fcb C$CR | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
48 DshSh fcs "----- --- --- --- --- -------" |
842 | 49 ActSh fcs " act " |
50 WaiSh fcs " wai " | |
51 SleSh fcs " sle " | |
14 | 52 L005E fcb C$LF |
53 fcc "Usr # id pty state mem primary module" | |
54 fcb C$CR | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
55 DshLo fcs "----- --- --- -------- --- --------------" |
842 | 56 ActLo fcs " active " |
57 WaiLo fcs " waiting " | |
58 SleLo fcs " sleeping " | |
14 | 59 |
842 | 60 start clr <eflag |
61 clr <narrow | |
14 | 62 pshs y,x,b,a |
63 lda #$01 | |
64 ldb #SS.ScSiz | |
65 os9 I$GetStt | |
66 bcc L00E8 | |
67 cmpb #E$UnkSvc | |
68 beq L00EF | |
69 puls y,x,b,a | |
70 lbra L01F1 | |
842 | 71 L00E8 cmpx #50 |
72 bge L00EF | |
73 inc <narrow | |
14 | 74 L00EF puls y,x,b,a |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
75 * |
842 | 76 * Check for a '-E' as argument |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
77 * |
842 | 78 ldd ,x+ |
79 andb #$DF | |
80 cmpd #$2D45 | |
14 | 81 bne L00FB |
842 | 82 inc <eflag |
83 L00FB leax buffer,u | |
84 stx <bufptr | |
14 | 85 orcc #IntMasks |
185 | 86 ldx >D.AProcQ |
842 | 87 stx <aproc |
185 | 88 ldx >D.WProcQ |
842 | 89 stx <wproc |
185 | 90 ldx >D.SProcQ |
842 | 91 stx <sproc |
185 | 92 ldx >D.Proc |
93 ldd P$User,x | |
842 | 94 std <myuid |
0 | 95 pshs u |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
96 leau >PsBuf,u Assign buffer to reg u |
0 | 97 lda #$01 |
842 | 98 ldx <aproc |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
99 lbsr LoopP |
0 | 100 lda #$02 |
842 | 101 ldx <wproc |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
102 lbsr LoopP |
0 | 103 lda #$03 |
842 | 104 ldx <sproc |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
105 lbsr LoopP |
185 | 106 andcc #^IntMasks |
0 | 107 clra |
108 clrb | |
109 pshu b,a | |
110 pshu b,a | |
111 puls u | |
842 | 112 tst <narrow |
14 | 113 beq L0156 |
0 | 114 leay >L0013,pcr |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
115 lbsr WritY |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
116 lbsr WrBuf |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
117 leay >DshSh,pcr Write short dashes |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
118 lbsr WritY |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
119 lbsr WrBuf |
14 | 120 bra L016A |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
121 |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
122 * Write 80 char header |
14 | 123 L0156 leay >L005E,pcr |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
124 lbsr WritY |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
125 lbsr WrBuf |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
126 leay >DshLo,pcr Write long dashes |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
127 lbsr WritY |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
128 lbsr WrBuf |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
129 |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
130 L016A leax >PsBuf,u |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
131 NextW leax -$09,x |
0 | 132 ldd $05,x |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
133 beq Finish |
0 | 134 ldd $07,x |
14 | 135 lbsr L0250 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
136 lbsr WrSpc Write Space |
0 | 137 ldb ,x |
14 | 138 lbsr L0214 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
139 lbsr WrSpc Write Space |
0 | 140 ldb $03,x |
14 | 141 lbsr L0214 |
0 | 142 lda $04,x |
842 | 143 tst <narrow |
14 | 144 beq L0195 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
145 leay >ActSh,pcr |
14 | 146 bra L0199 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
147 L0195 leay >ActLo,pcr |
14 | 148 L0199 cmpa #$01 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
149 beq L01BD branch if status is active |
842 | 150 tst <narrow |
14 | 151 beq L01A7 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
152 leay >WaiSh,pcr |
14 | 153 bra L01AB |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
154 L01A7 leay >WaiLo,pcr |
14 | 155 L01AB cmpa #$02 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
156 beq L01BD branch if status is waiting |
842 | 157 tst <narrow |
14 | 158 beq L01B9 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
159 leay >SleSh,pcr |
14 | 160 bra L01BD |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
161 L01B9 leay >SleLo,pcr |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
162 L01BD bsr WritY |
0 | 163 ldb $02,x |
14 | 164 bsr L0214 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
165 bsr WrSpc Write Space |
0 | 166 ldy $05,x |
167 ldd $04,y | |
168 leay d,y | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
169 bsr WritY |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
170 bsr WrSpc Write Space |
842 | 171 tst <narrow |
14 | 172 bne L01EB |
185 | 173 lda #'< |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
174 bsr WriCh |
14 | 175 lda $01,x |
176 lbsr L02B5 | |
177 bcs L01EB | |
178 ldy $03,y | |
179 ldy $04,y | |
180 ldd $04,y | |
181 leay d,y | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
182 bsr WritY |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
183 L01EB bsr WrBuf |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
184 lbra NextW Next line |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
185 |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
186 Finish clrb |
14 | 187 L01F1 os9 F$Exit |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
188 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
189 * Write text pointed to by Reg Y to buffer |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
190 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
191 WritY lda ,y |
0 | 192 anda #$7F |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
193 bsr WriCh |
0 | 194 lda ,y+ |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
195 bpl WritY |
0 | 196 rts |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
197 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
198 * Write out buffer to stdout (max 80 chars) |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
199 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
200 WrBuf pshs y,x,a |
185 | 201 lda #C$CR |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
202 bsr WriCh |
842 | 203 leax buffer,u |
204 stx <bufptr | |
185 | 205 ldy #80 |
0 | 206 lda #$01 |
207 os9 I$WritLn | |
208 puls pc,y,x,a | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
209 |
14 | 210 L0214 clr <u000A |
0 | 211 lda #$FF |
14 | 212 L0218 inca |
842 | 213 subb #100 |
14 | 214 bcc L0218 |
215 bsr L022E | |
842 | 216 lda #10 |
14 | 217 L0221 deca |
842 | 218 addb #10 |
14 | 219 bcc L0221 |
220 bsr L022E | |
0 | 221 tfr b,a |
842 | 222 adda #'0 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
223 bra WriCh |
14 | 224 L022E tsta |
225 beq L0233 | |
226 sta <u000A | |
227 L0233 tst <u000A | |
228 bne L0239 | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
229 WrSpc lda #$F0 |
842 | 230 L0239 adda #'0 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
231 * |
842 | 232 * Add char to buffer pointed to by bufptr |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
233 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
234 WriCh pshs x |
842 | 235 ldx <bufptr |
0 | 236 sta ,x+ |
842 | 237 stx <bufptr |
0 | 238 puls pc,x |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
239 |
14 | 240 L0245 fcb $27,$10,$03,$e8,$00,$64,$00,$0a,$00,$01,$ff |
842 | 241 |
185 | 242 L0250 pshs x,y,a,b |
14 | 243 leax <L0245,pcr |
0 | 244 ldy #$2F20 |
14 | 245 L0259 leay >$0100,y |
0 | 246 subd ,x |
14 | 247 bcc L0259 |
0 | 248 addd ,x++ |
249 pshs b,a | |
250 tfr y,d | |
251 tst ,x | |
14 | 252 bmi L0281 |
0 | 253 ldy #$2F30 |
254 cmpd #$3020 | |
14 | 255 bne L027B |
0 | 256 ldy #$2F20 |
185 | 257 lda #C$SPAC |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
258 L027B bsr WriCh |
0 | 259 puls b,a |
14 | 260 bra L0259 |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
261 L0281 bsr WriCh |
0 | 262 leas $02,s |
263 puls pc,y,x,b,a | |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
264 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
265 * Loop through list of processes |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
266 * Reg X contains the pointer |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
267 * |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
268 LoopP pshs y,b,a |
185 | 269 leax ,x point to first entry in queue |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
270 beq EndP |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
271 NextP ldd P$User,x |
842 | 272 tst <eflag |
14 | 273 bne L0298 |
842 | 274 cmpd <myuid |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
275 bne ContP |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
276 L0298 pshu b,a put userid on stack |
185 | 277 lda P$Prior,x |
0 | 278 ldb ,s |
185 | 279 ldy <P$PModul,x |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
280 pshu y,b,a put module,priority,status on stack |
185 | 281 lda P$PagCnt,x |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
282 pshu a put pagecount on stack |
185 | 283 lda P$ID,x |
284 ldb <P$PATH,x | |
0 | 285 pshu b,a |
716
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
286 ContP ldx P$Queue,x |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
287 bne NextP |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
288 EndP puls pc,y,b,a |
790d0bf87621
Commented procs, since it is used to figure out what has to be
roug
parents:
200
diff
changeset
|
289 |
14 | 290 L02B5 pshs x,b,a |
185 | 291 ldx >D.PthDBT |
0 | 292 tsta |
14 | 293 beq L02CC |
0 | 294 clrb |
295 lsra | |
296 rorb | |
297 lsra | |
298 rorb | |
299 lda a,x | |
300 tfr d,y | |
14 | 301 beq L02CC |
0 | 302 tst ,y |
14 | 303 bne L02CD |
304 L02CC coma | |
305 L02CD puls pc,x,b,a | |
306 | |
0 | 307 emod |
308 eom equ * | |
14 | 309 end |