annotate level2/cmds/proc.asm @ 1500:b00cf13c9f61

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