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