annotate level2/cmds/proc.asm @ 1099:b77631456f91

Change to makefile
author roug
date Wed, 09 Apr 2003 19:02:19 +0000
parents 53553cdc265c
children bf6f854a4299
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
1 ********************************************************************
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
2 * Proc - Show process information
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
3 *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
4 * $Id$
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
5 *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
6 * NOTE: SHOULD ADD IN TO HANDLE PRINTING NAME OF CURRENT MODULE
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
7 * RUNNING IN A RUNB or BASIC09 PROCESS
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
8 *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
9 * From "Inside Level II" by Kevin Darling
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
10 *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
11 * Ed. Comments Who YY/MM/DD
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
12 * ------------------------------------------------------------------
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
13 * 1 Original version KKD 88/10/28
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
14 * ? Modified to show status in English, stderr ??? 89/07/30
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
15 * and the system process
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
16 * 11 Modified to add current executing/editing LCB 94/11/08
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
17 * module name for Basic09 and/or RunB programs
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
18
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
19 nam Proc
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
20 ttl Show process information
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
21
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
22 ifp1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
23 use defsfile
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
24 endc
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
25
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
26 Type set Prgrm+Objct
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
27 Revs set ReEnt+1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
28 edition set 11
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
29
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
30 bufsiz set 512
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
31 stdout set 1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
32
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
33 pag
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
34 ***************************************************
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
35 mod PrgSiz,Name,Type,Revs,Entry,DatSiz
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
36
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
37 Name fcs /Proc/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
38 fcb edition
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
39
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
40 * Data Equates
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
41 umem rmb 2 Data mem ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
42 sysimg rmb 2 pointer to sysprc datimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
43 datimg rmb 2 datimg for copymem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
44 datimg2 rmb 2 2nd copy for non-descriptor use
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
45 basicflg rmb 1 Flag that primary module is BASIC09 or RUNB
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
46 outptr rmb 2 pointer in outbuf
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
47 number rmb 3
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
48 leadflag rmb 1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
49 path rmb 3 stdin, stdout and stderr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
50 pid rmb 1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
51 namlen rmb 1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
52 hdr rmb 64
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
53 outbuf rmb 80 Buffer for output string
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
54 buffer rmb bufsiz working proc. desc.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
55 sysprc rmb bufsiz system proc. desc.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
56 stack rmb 200
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
57 datsiz equ .
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
58
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
59 **************************************************
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
60 * Messages
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
61 * Headers
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
62 Header fcc " ID Prnt User Pty Age Tsk Status Signal Module I/O Paths "
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
63 fcb C$CR
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
64 Hdrlen equ *-Header
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
65
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
66 Header2 fcc /___ ____ ____ ___ ___ ___ _______ __ __ _________ __________________/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
67 Hdrcr fcb C$CR
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
68 Hdrlen2 equ *-Header2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
69
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
70 * State Strings (6 characters each)
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
71 Quesstr fcc /??????/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
72 TimSlpSt fcc /TSleep/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
73 TimOStr fcc /TimOut/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
74 ImgChStr fcc /ImgChg/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
75 SuspStr fcc /Suspnd/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
76 CondmStr fcc /Condem/
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
77 DeadStr fcc /Dead /
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
78 Spaces fcc / /
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
79 SystmSt fcc /System /
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
80
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
81 * Special case module names
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
82 basic09 fcc 'BASIC'
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
83 b09sz equ *-basic09
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
84 runb fcc 'RUNB'
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
85 runbsz equ *-runb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
86 basicms2 fcc ')'
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
87 fcb C$CR
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
88 Nomodule fcc 'Not Defined'
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
89 Nomodsz equ *-Nomodule
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
90
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
91 ************************************************
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
92 Entry stu <Umem save data mem ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
93 lda #stdout Std out path=1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
94 leax Hdrcr,PC print blank line
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
95 ldy #1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
96 os9 I$WritLn
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
97 bcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
98 leax Header,pcr Print header line 1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
99 ldy #Hdrlen
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
100 os9 I$WritLn
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
101 bcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
102 leax Header2,pcr Print header line 2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
103 ldy #Hdrlen2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
104 os9 I$WritLn
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
105 bcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
106 lda #1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
107 leax >sysprc,U get system proc. desc.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
108 os9 F$GPrDsc
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
109 bcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
110 leax P$DatImg,X just for its dat image
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
111 stx <sysimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
112 clra set <pid = start -1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
113 sta <basicflg Default: not a RUNB or BASIC09
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
114 sta <pid
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
115
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
116 * Main Program Loop
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
117 Main ldu <umem Get data mem ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
118 leax OutBuf,U Point to line buffer to print to screen
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
119 stx <outptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
120 inc <pid next process
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
121 beq Exit If wrapped, we are done
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
122 lda <pid get proc ID to check
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
123 leax Buffer,U Point to place to hold process dsc.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
124 os9 F$GPrDsc Get it
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
125 bcs Main loop if no descriptor
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
126 bsr Output print data for descriptor
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
127 bra Main Do rest of descriptors
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
128
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
129 Exit clrb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
130 Error os9 F$Exit
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
131
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
132 ***********************************************
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
133 * Subroutines
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
134 * Print Data re Process
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
135 * Entry: X=Ptr to buffer copy of process descriptor (Buffer,u)
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
136 Output lda P$ID,X process id
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
137 lbsr Outdecl print pid
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
138 lda P$PID,X parent's id
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
139 lbsr Outdecl
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
140 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
141 ldd P$User,X user id
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
142 lbsr Outdec
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
143 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
144 lda P$Prior,X priority
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
145 lbsr Outdecl
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
146 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
147 lda P$Age,X age
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
148 lbsr Outdecl
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
149 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
150 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
151 lda P$Task,X task no.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
152 lbsr Out2HS
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
153 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
154 lda P$State,X state
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
155 pshs X save X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
156 lbsr OutState
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
157 puls X restore x
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
158 lda P$Signal,X signal
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
159 lbsr Outdecl - in decimal
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
160 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
161 lda P$Signal,X signal
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
162 lbsr Out2HS - in hex
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
163 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
164 ldd P$Path,X get stdin and stdout
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
165 std <path
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
166 lda P$Path+2,X and stderr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
167 sta <path+2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
168 * Print primary module name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
169 * IN: X - ptr to process descriptor copy (buffer,u)
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
170 leay P$DATImg,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
171 tfr Y,D d=dat image
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
172 std <datimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
173 std <datimg2 2nd copy for 2ndary name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
174 lda <pid working on system process?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
175 cmpa #1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
176 beq Outp2 yes, print name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
177 ldx P$PModul,X x=offset in map
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
178 ldb #9 set minimum space padded size of name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
179 stb <namlen
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
180 lbsr Printnam Go append name to buffer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
181 bra Outp3
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
182
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
183 Outp2 leax SystmSt,pcr print "System"
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
184 ldb #9 name length
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
185 lbsr PutSt1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
186 * Print Standard input Device
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
187 Outp3 lbsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
188 lda #'<
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
189 lbsr Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
190 lbsr Device
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
191 lda <path+1 get stdout
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
192 sta <path
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
193 lda #'>
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
194 lbsr Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
195 lbsr Device
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
196 Stderr lda <path+2 get stderr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
197 sta <path
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
198 lda #'>
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
199 lbsr Print print first >
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
200 lda #'>
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
201 lbsr Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
202 bsr Device
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
203 * Print Line
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
204 ldx <outptr now print line
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
205 lda #C$CR
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
206 sta ,X terminate line with CR
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
207 ldu <umem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
208 leax outbuf,U Print it (up to 80 chars)
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
209 ldy #80
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
210 lda #stdout
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
211 os9 I$Writln
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
212 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
213 lda <basicflg Was module RUNB or BASIC09?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
214 beq notbasic No, finished this entry
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
215 clr <basicflg Yes, clear out flag for 2nd call to Printnam
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
216 leax outbuf,u Point to output buffer start
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
217 ldd #$20*256+45 45 spaces
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
218 copylp sta ,x+ Put spaces into output buffer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
219 decb Drop size counter
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
220 bne copylp Copy entire message
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
221 lda #'( Add opening parenthesis
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
222 sta ,x+
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
223 stx <outptr Save new output buffer ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
224 ldd <datimg2 Get programs DAT img
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
225 std <datimg Save over descriptor one
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
226 ldx #$002f $002f in basic09 is ptr to current module
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
227 ldy #2 Just need ptr for now
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
228 ldu <umem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
229 leau hdr,u Point to place to hold it
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
230 os9 F$CpyMem Get current module ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
231 ldu <umem Get data mem ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
232 ldx hdr,u Get ptr to module start in BASIC09 workspace
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
233 beq NotDef If 0, no 'current module' defined
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
234 lbsr Printnam Go append sub-module name to output buffer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
235 bra printit Add closing chars & print it
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
236
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
237 NotDef ldx <outptr Get current output buffer ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
238 leay Nomodule,pcr Point to 'Not Defined'
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
239 ldb #Nomodsz Size of message
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
240 Notlp lda ,y+ Copy it
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
241 sta ,x+
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
242 decb Until done
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
243 bne Notlp
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
244 stx <outptr Save output buffer ptr for below
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
245 printit ldd basicms2,pcr Get closing ')' + CR
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
246 ldx <outptr Get current output buffer ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
247 std ,x Append to output buffer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
248 ldu <umem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
249 leax outbuf,U Print it (up to 80 chars)
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
250 ldy #80
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
251 lda #stdout
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
252 os9 I$Writln
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
253 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
254 notbasic rts
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
255
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
256 * Print Character in A and Device Name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
257 Device ldu <umem restore U
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
258 lda <path
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
259 bne Device2 if <path = 0, print spaces
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
260 leax Spaces,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
261 lbra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
262
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
263 * Get device name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
264 Device2 leau hdr,U get table offset in sys map
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
265 ldd <sysimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
266 ldx #D.PthDBT from direct page
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
267 ldy #2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
268 os9 F$CpyMem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
269 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
270 ldx hdr get <path descriptor table
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
271 ldy #64
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
272 ldd <sysimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
273 os9 F$CpyMem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
274 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
275 ldb <path point to <path block
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
276 lsrb four <paths/ block
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
277 lsrb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
278 lda B,U a=msb block addr.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
279 pshs A
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
280 ldb <path point to <path
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
281 andb #3
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
282 lda #$40
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
283 mul
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
284 puls A d= <path descriptor address
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
285 addb #PD.Dev get device table pointer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
286 tfr D,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
287 ldd <sysimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
288 ldy #2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
289 os9 F$CpyMem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
290 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
291 ldx hdr x= dev. table entry sys.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
292 ldb #V$Desc we want descr. pointer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
293 abx
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
294 ldd <sysimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
295 ldy #2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
296 os9 F$CpyMem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
297 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
298 ldx hdr get descriptor addr.
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
299 ldu <umem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
300 ldd <sysimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
301 std <datimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
302 ldb #5
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
303 stb <namlen
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
304 ** Find and print a module name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
305 * IN: X - module offset
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
306 * U - data area
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
307 * <datimg = pointer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
308 * Read module header
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
309 Printnam pshs U save u
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
310 leau hdr,U destination
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
311 ldd <datimg proc <datimg pointer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
312 ldy #10 set length (M$Name ptr is @ 4)
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
313 os9 F$CpyMem Get 1st 10 bytes of module header
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
314 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
315 * Read name from Module to buffer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
316 ldd M$Name,U get name offset from header
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
317 ldu <outptr move name to outbuf
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
318 leax D,X X - offset to name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
319 ldd <datimg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
320 ldy #40 max length of name we will accept
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
321 os9 F$CpyMem Get copy of module name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
322 puls U
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
323 lbcs Error
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
324
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
325 pshs X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
326 ldx <outptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
327 pshs X Save start of module name ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
328 clrb set length = 0
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
329 Name3 incb Bump up # chars long name is
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
330 lda ,X+ Get char from module name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
331 bpl Name3 No hi-bit terminator yet, keep checking
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
332 cmpb #40 Done, is it >39 chars?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
333 bhs Name5 Yes, skip ahead
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
334 anda #$7F Take out hi-bit
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
335 sta -1,X Save char back without hi-bit
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
336 cmpb <namlen Bigger than max name size we allow?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
337 bhs Name5 No, skip ahead
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
338 lda #C$SPAC If smaller, pad with spaces
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
339 Name4 sta ,X+
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
340 incb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
341 cmpb <namlen
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
342 blo Name4
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
343 Name5 stx <outptr Save new output buffer ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
344 lda <basicflg Are we here doing a basic09 sub-module?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
345 bne notbas Yes, don't get stuck in recursive loop
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
346 ldx ,s Get ptr to start of module name again
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
347 leay basic09,pcr Check for BASIC09 1st
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
348 ldb #b09sz Size of module to check
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
349 chkb09lp lda ,x+ Get char from module name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
350 anda #$df Force to uppercase
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
351 cmpa ,y+ Same as one for BASIC09?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
352 bne chkrunb No, check runb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
353 decb Done 'BASIC' yet?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
354 bne chkb09lp No, keep checking
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
355 ldd ,x++ Get last 2 chars from name
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
356 cmpd #$3039 '09'?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
357 bne chkrunb No, try runb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
358 lda ,x Next char space (end of name)?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
359 cmpa #C$SPAC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
360 beq setflag Yes, set basic09 flag
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
361 chkrunb leay runb,pcr Point to 'runb'
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
362 ldb #runbsz
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
363 ldx ,s Get ptr to name in buffer
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
364 chkrunlp lda ,x+ Get char
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
365 anda #$df Force to uppercase
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
366 cmpa ,y+ Match?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
367 bne notbas No, not either basic
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
368 decb Done whole check?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
369 bne chkrunlp No, keep checking
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
370 setflag sta <basicflg Set basic09 flag
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
371 notbas leas 2,s Eat start of module name ptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
372 puls X,PC Restore X & return
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
373
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
374 * Print Hexidecimal Digit in D
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
375 Out4HS pshs B
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
376 bsr Hexl
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
377 puls A
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
378 Out2HS bsr Hexl
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
379
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
380 Spce lda #C$SPAC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
381 bra Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
382
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
383 * Print Hexidecimal Digit in A
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
384 Hexl tfr A,B
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
385 lsra
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
386 lsra
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
387 lsra
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
388 lsra
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
389 bsr Outhex
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
390 tfr B,A
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
391 Outhex anda #$0F
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
392 cmpa #$0A 0 - 9
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
393 bcs Outdig
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
394 adda #$07 A - F
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
395 Outdig adda #'0 make ASCII
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
396
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
397 Print pshs X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
398 ldx <outptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
399 sta ,X+
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
400 stx <outptr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
401 puls X,PC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
402
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
403 * Print 1 Decimal Digit in B
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
404 *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
405 Outdecl tfr A,B <number to B
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
406 clra
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
407
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
408 * Print 2 Decimal Digits in D
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
409 Outdec clr <leadflag
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
410 pshs X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
411 ldx <umem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
412 leax <number,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
413 clr ,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
414 clr 1,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
415 clr 2,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
416 Hundred inc ,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
417 subd #100
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
418 bcc Hundred
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
419 addd #100
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
420 Ten inc 1,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
421 subd #10
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
422 bcc Ten
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
423 addd #10
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
424 incb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
425 stb 2,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
426 bsr Printled
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
427 bsr Printled
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
428 bsr Printnum
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
429 bsr Spce
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
430 puls X,PC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
431
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
432 Printnum lda ,X+ get char
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
433 adda #$30-1 make ASCII
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
434 bra Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
435
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
436 Printled tst <leadflag print leading zero?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
437 bne Printnum yes
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
438 ldb ,X is it zero?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
439 inc <leadflag
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
440 decb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
441 bne Printnum no, print zeros
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
442 clr <leadflag
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
443 lda #C$SPAC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
444 leax 1,X
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
445 bra Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
446
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
447 * Print process state in English
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
448 * IN: A = P$State
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
449 OutState tfr A,B
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
450 bitb #SysState system?
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
451 beq OutSt1 no
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
452 lda #'s s = System state
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
453 bra OutSt2
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
454
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
455 OutSt1 lda #C$SPAC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
456
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
457 OutSt2 bsr Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
458 bitb #TimSleep
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
459 bne PTimSlp
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
460 bitb #TimOut
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
461 bne PTimOut
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
462 bitb #ImgChg
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
463 bne PImgCh
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
464 bitb #Suspend
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
465 bne PSuspnd
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
466 bitb #Condem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
467 bne PCondem
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
468 bitb #Dead
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
469 bne PDead
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
470 bitb #$04
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
471 bne PQues
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
472 leax Spaces,pcr nothing to report
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
473 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
474
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
475 PQues leax QuesStr,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
476 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
477
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
478 PTimSlp leax TimSlpSt,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
479 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
480
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
481 PTimOut leax TimOStr,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
482 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
483
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
484 PImgCh leax ImgChStr,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
485 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
486
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
487 PSuspnd leax SuspStr,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
488 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
489
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
490 PCondem leax Condmstr,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
491 bra PutStr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
492
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
493 PDead leax Deadstr,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
494
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
495 Putstr ldb #6 six characters
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
496
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
497 Putst1 lda ,X+
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
498 lbsr Print
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
499 decb
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
500 bne PutSt1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
501 rts
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
502
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
503 emod
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
504 Prgsiz equ *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
505 end