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