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

Major changes for new NitrOS-9 manual
author boisy
date Mon, 05 Jan 2004 00:51:19 +0000
parents bf6f854a4299
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
967
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
1 ********************************************************************
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
2 * DirM - Show module directory
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
3 *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
4 * $Id$
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
5 *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
6 * Changes:
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
7 *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
8 * Added internal print buffer, so an I$Write call is not performed for every
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
9 * byte printed out. Halves printout time.
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
10 *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
11 * Added SS.ScSiz check, and goes to 32-column output if display is 40 columns
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
12 * or less.
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
13 *
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
14 * Edt/Rev YYYY/MM/DD Modified by
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
15 * Comment
967
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
16 * ------------------------------------------------------------------
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
17 * ? 1994/11/10 Alan DeKok
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
18 * Disassembled at 8:18:38
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
19 *
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
20 * 5 ????/??/?? Alan DeKok
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
21 * Added internal print buffer, so an I$Write call is not performed for
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
22 * every byte printed out. Halves printout time. Added SS.ScSiz check
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
23 * and goes to 32-column output if display is 40 columns or less.
967
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
24
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
25 nam DirM
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
26 ttl Show module directory
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
27
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
28 ifp1
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
29 use defsfile
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
30 endc
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
31
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
32 tylg set Prgrm+Objct
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
33 atrv set ReEnt+rev
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 967
diff changeset
34 rev set $00
967
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
35 edition set 5
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
36
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
37 Bound equ 40 width at which change is made to 32-col printing
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
38
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
39
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
40 mod eom,name,tylg,atrv,start,size
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
41
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
42 MD.DAT rmb 2
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
43 MD.Crnt rmb 2
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
44 MD.Strt rmb 2
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
45 MD.End rmb 2
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
46 MD.MPDAT rmb 5
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
47 PntCnt rmb 1
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
48
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
49 *Single rmb 1 single entry/line?
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
50 Width rmb 1 width of the output device
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
51
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
52 PBuffer rmb 31 internal print buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
53 Buffer rmb 40 room for a name buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
54 MD.Data rmb 2048 size of the module directory
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
55 rmb 200 for the stack
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
56 size equ .
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
57 name equ *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
58 fcs /DirM/
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
59 fcb edition
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
60
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
61 H2 fcc / Bk Ofst Size Ty At Link Name/
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
62 fcb C$CR
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
63 H3 fcc / -- ---- ---- -- -- ---- -----/
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
64 H1 fcb C$CR
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
65
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
66 * Believe it or not, all this internal crap is still smaller than having
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
67 * a different version of the header for 32/80 columns.
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
68 Dump ldu #PBuffer output print buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
69 lda ,x+ get first character
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
70 sta ,u+ move it over
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
71 ldb <Width get the width
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
72
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
73 D.01 cmpa #C$CR CR?
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
74 beq D.Print yup, dump it out
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
75
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
76 lda ,x+ grab a character
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
77 sta ,u+ save it
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
78 cmpa #C$SPAC was it a space?
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
79 bne D.01 no, just save it
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
80
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
81 cmpb #Bound 40-column screen?
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
82 bls D.01 yes, don't add the space
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
83 sta ,u+ if a space, save another copy of it
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
84 bra D.01
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
85
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
86 D.Print lda #$01 to STDOUT
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
87 ldx #PBuffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
88 ldy #50 max. size of data to print
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
89 OS9 I$WritLn dump it out
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
90 bcs Exit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
91 rts
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
92
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
93 start equ *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
94 stu <MD.DAT u=$0000 always on startup in OS-9 LII
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
95 ldd #$0100+SS.ScSiz stdout, get screen size
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
96 OS9 I$GetStt
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
97 bcs s.01
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
98 tfr x,d
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
99 bra s.02 save actual screen size
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
100
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
101 s.01 cmpb #E$UnkSvc
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
102 bne Exit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
103 ldb #80 default to 80 columns if error
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
104 s.02 stb <Width
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
105
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
106 leax <H1,pcr print out initial CR
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
107 bsr Dump
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
108 leax >H2,pcr header of names
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
109 bsr Dump
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
110 leax <H3,pcr and hyphens
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
111 bsr Dump
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
112
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
113 ldx #MD.Data
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
114 os9 F$GModDr
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
115 bcs Exit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
116 stu <MD.Strt save start address of system module dir
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
117
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
118 sty <MD.End save end of the module directory
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
119 bra L00B5
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
120
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
121 ClnExit clrb
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
122 Exit os9 F$Exit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
123
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
124 L00AD ldx <MD.Crnt
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
125 leax MD$ESIZE,x go to the next entry
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
126 cmpx <MD.End
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
127 bcc ClnExit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
128
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
129 L00B5 stx <MD.Crnt
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
130 ldu #PBuffer temporary print buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
131 ldd MD$MPDAT,x get module DAT image
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
132 beq L00AD if zero, skip this entry
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
133 pshs d
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
134 cmpd <MD.DAT
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
135 beq L00CD
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
136 std <MD.DAT save the current DAT image
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
137 lda #'- start of this block
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
138 fcb $8C skip 2 bytes
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
139
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
140 L00CD lda #C$SPAC space
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
141 sta ,u+ store it in the data buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
142 L00D0 puls d restore current DAT image
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
143 subd <MD.Strt take out start of the block
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
144 ldy #MD.Data point to module directory data
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
145 leay d,y to the DAT image within it
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
146 tfr y,d
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
147 std <MD.MPDAT save pointer to DAT
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
148 lda MD$MPtr,x module pointer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
149 lsra
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
150 lsra
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
151 lsra
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
152 lsra turn address into block offset
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
153 anda #$0E keep low bits only
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
154 inca DAT image is (junk),(block)
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
155 lda a,y get the starting block number
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
156 bsr L0165 dump it out
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
157 ldd MD$MPtr,x get real pointer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
158 anda #$1F get offset inside block
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
159 bsr L0159 print it out
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
160 ldx MD$MPtr,x and get pointer again
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
161
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
162 pshs u save print buffer pointer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
163 ldu #Buffer to a name buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
164 ldy #$000A move first 10 bytes of the module?
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
165 ldd <MD.MPDAT
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
166 os9 F$CpyMem copy it over
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
167 puls u restore print buffer ptr
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
168 bcs Exit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
169
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
170 ldd <Buffer+M$Size
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
171 bsr L0159 print out the size of the module
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
172 lda <Buffer+M$Type
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
173 bsr L0165 print out the Ty/Lg
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
174 lda <Buffer+M$Revs
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
175 bsr L0165 print out At/Rv
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
176 ldx <MD.Crnt get current module pointer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
177 ldd MD$Link,x link count
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
178 bsr L0159
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
179 ldd <Buffer+M$Name
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
180 ldx <MD.Crnt
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
181 ldx MD$MPtr,x start address of the module
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
182 leax d,x point to the name
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
183
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
184 pshs u save print buffer ptr
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
185 ldu #Buffer to the buffer again
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
186 lda <Width
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
187 cmpa #Bound
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
188 bhi n.01
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
189 leau -6,u discount 6 spaces
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
190
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
191 n.01 ldd <MD.MPDAT
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
192 ldy #40 copy over 40 bytes of the name
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
193 os9 F$CpyMem
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
194 tfr u,x save copy of the start of the buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
195 puls u restore print buffer ptr
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
196 lbcs Exit
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
197
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
198 ldb #39 maximum number of characters to check
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
199 L013F lda ,x+ get a character
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
200 bpl L013F if it's OK
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
201 anda #$7F force it to be printable
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
202 sta -1,x save it again
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
203 lda #C$CR drop a CR after the last character of the name
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
204
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
205 sta ,x save it
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
206 ldx #PBuffer point to the start of the buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
207 ldy #64 64 characters
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
208 lda #$01
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
209 os9 I$WritLn print out the name
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
210 lbra L00AD start all over again
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
211
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
212 * Print out a 2-byte hex number in D
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
213 L0159 pshs b save low order character
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
214 ldb #3 3 digits to print out
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
215 bsr L0171 print out A
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
216 puls a restore low byte
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
217 bsr L0173 print it, too
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
218 bra L0167 and dump out 2 spaces
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
219
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
220 * print out a 1-digit hex number in A
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
221 L0165 bsr L016F
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
222 L0167 lda <Width check the width
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
223 cmpa #Bound
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
224 bls L016B if 40 columns or smaller, don't print extra space
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
225 lda #C$SPAC space
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
226 sta ,u+
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
227 L016B lda #C$SPAC and another space
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
228 sta ,u+
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
229 rts
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
230
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
231 L016F ldb #$01
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
232 L0171 stb <PntCnt
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
233 L0173 tfr a,b save a copy of the number in B
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
234 lsra
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
235 lsra
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
236 lsra
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
237 lsra move high nibble into the lower nibble
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
238 bsr L017D print out lower nibble of A as hex number
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
239 tfr b,a restore lower nibble
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
240
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
241 L017D anda #$0F make 0-15
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
242 beq L019C if zero, skip printing it out
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
243 clr <PntCnt
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
244 cmpa #$0A higher than A?
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
245 bcs L0189 no, add in ascii zero
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
246 adda #$07 yes, add difference between 9 and A
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
247 L0189 adda #'0 turn it into an ascii number
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
248
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
249 Print sta ,u+ save the character in the buffer
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
250 rts
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
251
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
252 L019C dec <PntCnt count down of number of characters to print
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
253 bmi L0189 if last one, print out a zero
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
254 bra L016B otherwise print out a space
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
255
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
256 emod
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
257 eom equ *
835a015e3f3b Added to CMDS
boisy
parents:
diff changeset
258 end