annotate level2/cmds/pmap.asm @ 2055:e89b629e1f61

Removed makefiles
author boisy
date Sun, 23 Apr 2006 22:32:53 +0000
parents 90cb94c964d9
children 6b012cf1b400
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * PMap - Show process map information
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * From "Inside Level II" by Kevin Darling
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 *
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
8 * Edt/Rev YYYY/MM/DD Modified by
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
9 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 * ------------------------------------------------------------------
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
11 * ? 1987/02/08 Kevin Darling
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
12 * Original version.
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
13 *
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
14 * 2 1989/09/12 Ken Drexler
1350
8e90ef1b670e Rolled into Level 1 unlink.asm
boisy
parents: 1255
diff changeset
15 * Revised to handle 4K or 8K blocks.
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
16 *
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
17 * 3 2004/05/28 Rodney Hamilton
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
18 * Revised for NitrOS-9/OS9Tools compatibility.
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
19 * Revised to build for either 8K or 4K blocksize
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
20 * based on DAT parameters in SysType file.
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
21 *
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
22 * 4 2004/06/03 Rodney Hamilton
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
23 * Added test for DEAD processes.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 nam PMap
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 ttl Show process map information
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 Type set Prgrm+Objct
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 0
diff changeset
33 Revs set ReEnt+0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 Bufsiz set 512
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
35 Edition set 4
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
37 Stdout set 1
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
38 Maxnam set 30
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
39 Buflen set 80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 pag
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 ***************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 mod PrgSiz,Name,Type,Revs,Entry,DatSiz
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 Name fcs /PMap/
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
47 fcb Edition
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 * Data Equates
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 umem rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 datimg rmb 2 datimg for copymem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 lineptr rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 number rmb 3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 leadflag rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 pid rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 hdr rmb 12
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
57 outbuf rmb Buflen
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
58 buffer rmb Bufsiz working proc. desc.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 stack rmb 200
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
60 DatSiz equ .
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 *************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 * Messages
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 *
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
66 IFEQ DAT.BlSz-8192 8K blocks
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
67 Head1 fcc / ID 01 23 45 67 89 AB CD EF Program /
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 fcb C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
70 Head2 fcc /____ __ __ __ __ __ __ __ __ ___________/
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
71 ELSE 4K blocks
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
72 Head1 fcc / ID 0 1 2 3 4 5 6 7 8 9 A B C D E F Program/
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 fcb C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
75 Head2 fcc /____ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ _______/
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
76 ENDC
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
77 Hdrcr fcb C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 SysNam fcs "SYSTEM"
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
80 Syslen equ *-SysNam
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
81 DeadNam fcs "DEAD"
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
82 Deadlen equ *-DeadNam
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 spc 3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 ***************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 *
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
87 Entry stu <umem
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 lda #1 start with process 1
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
89 clr <pid
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 * Print header
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 leax buffer,u point at storage
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 os9 F$GBlkMp get block info
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 bcs Error
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
95 IFEQ DAT.BlSz-8192
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 cmpd #8192 8k?
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
97 ELSE
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 cmpd #4096 4k?
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
99 ENDC
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
100 bne Error we only do 4k/8k
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
102 leax <Hdrcr,pcr print line
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 lbsr PrintL1 print it
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
104 leax <Head1,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 lbsr PrintL1 print it
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
106 leax <Head2,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 lbsr PrintL1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 * Main Program Loop
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
111 Main ldu <umem
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
112 leax outbuf,u set line pointer
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
113 stx <lineptr
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
114 inc <pid next process
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 beq Bye >= 255 --> exit
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
116 lda <pid get proc id
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
117 leax buffer,u set destination
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 os9 F$GPrDsc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 bcs Main loop if no descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 bsr Output print data for descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 bra Main
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 Bye clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 Error os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 * Subroutines
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
128 Output lda P$ID,x process id
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 lbsr Outdecl
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 lbsr Space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 lbsr Space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 * Print Process DAT Image
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 * IN: x = process descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 *
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
136 pshs x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 leax P$DATImg,x point to DAT image
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
138 IFEQ DAT.BlSz-8192
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
139 ldb #DAT.BlCt set count
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
140 ELSE
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
141 ldb #64/4 set count
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
142 ENDC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 PrntImg ldd ,x++ get DAT block
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
146 cmpd #DAT.Free empty?
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
147 bne PrntImg2
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
148 ldy <lineptr
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
149 ldd #$2E2E was #".. (os9asm beta bug)
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 std ,y++
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
151 sty <lineptr
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
152 lbsr Space
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
153 bra PrntImg3
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 PrntImg2 tfr b,a print block no.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 lbsr Out2HS
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 PrntImg3 dec ,s count -= 1
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
159 bne PrntImg
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 puls b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 * Print primary module name
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 * IN: X - process descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 lbsr Space
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
166 leay P$DATImg,x
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
167 sty <datimg save pointer
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
168 ldb P$State,x check process state
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
169 andb #Dead was it DEAD?
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
170 beq Undead no, print name
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
171 leax >DeadNam,pcr
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
172 ldb #Deadlen
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
173 bra Copy0 yes, print "DEAD"
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
174
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
175 Undead ldx P$PModul,x x=offset in map
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
176 bne Doname
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
177 leax >SysNam,pcr point at name
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
178 ldb #Syslen
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
179 Copy0 ldy <lineptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 Copy lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 decb
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
184 bne Copy
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 bsr Name2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 bra Printlin
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 Doname bsr Printnam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 * Print Line
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
191 Printlin ldx <lineptr terminate line
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 lda #C$CR
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
193 sta ,x
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
194 ldu <umem
1597
88e86510c192 pmap updated by Rodney H.
boisy
parents: 1350
diff changeset
195 leax outbuf,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 * Print line
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
198 PrintL1 ldy #Buflen
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
199 lda #Stdout
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
200 os9 I$WritLn
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
201 lbcs Error
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 ** Find and print a module name
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 * IN: X - module offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 * U - data area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 * datimg = pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 Printnam equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 * Read module header
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
212 pshs u save u
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
213 leau hdr,u destination
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
214 ldd <datimg proc datimg pointer
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 ldy #10 set length
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 os9 F$CpyMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 lbcs Error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 * Read name from Module to buffer
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
220 ldd M$Name,u get name offset from header
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
221 ldu <lineptr move name to outbuf
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
222 leax d,x X - offset to name
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
223 ldd <datimg
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
224 ldy #Maxnam set maximum length
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 os9 F$CpyMem
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
226 puls u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 lbcs Error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
229 Name2 pshs x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
230 ldx <lineptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 clrb set length = 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 Name3 incb
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
233 lda ,x+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 bpl Name3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 cmpb #40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 bcc Name5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 anda #$7F clear d7
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
238 sta -1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 cmpb #9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 bcc Name5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 lda #C$SPAC
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
242 Name4 sta ,x+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 cmpb #9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 bcs Name4
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
246 Name5 stx <lineptr
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
247 puls x,pc
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 * Print hex digit in A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 Out2HS bsr Hexl
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 Space lda #C$SPAC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 bra Print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 * Print Hexidecimal Digit in A
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
257 Hexl tfr a,b
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 bsr Outhex
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
263 tfr b,a
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 Outhex anda #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 cmpa #$0A 0 - 9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 bcs Outdig
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 adda #$07 A - F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 Outdig adda #'0 make ASCII
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 * Put character in A in buf
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
271 Print pshs x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
272 ldx <lineptr
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
273 sta ,x+
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
274 stx <lineptr
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
275 puls x,pc
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 * Print 1 Decimal Digit in A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 *
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
279 Outdecl tfr a,b number to B
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 * Print 2 Decimal Digits in D
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
283 Outdec clr <leadflag
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
284 pshs x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
285 ldx <umem
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
286 leax number,x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
287 clr ,x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
288 clr 1,x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
289 clr 2,x
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
290 Hundred inc ,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 subd #100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 bcc Hundred
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 addd #100
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
294 Ten inc 1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 subd #10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 bcc Ten
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297 addd #10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298 incb
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
299 stb 2,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 bsr Printled
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 bsr Printled
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 bsr Printnum
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 bsr Space
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
304 puls x,pc
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
306 Printnum lda ,x+ get char
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 adda #'0-1 make ASCII
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 bra Print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
310 Printled tst <leadflag print leading zero?
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 bne Printnum yes
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
312 ldb ,x is it zero?
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
313 inc <leadflag
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
314 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315 bne Printnum no, print zeros
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
316 clr <leadflag
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 lda #C$SPAC
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
318 leax 1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 bra Print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321 emod
1601
90cb94c964d9 Rodney's fixes
boisy
parents: 1597
diff changeset
322 PrgSiz equ *
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 end