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

Change to makefile
author roug
date Wed, 09 Apr 2003 19:02:19 +0000
parents 6641a883d6b0
children a3d0ac951684
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 * MMap - Show memory block map
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 Kevin Darling, "Inside OS9 Level II"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9 * ------------------------------------------------------------------
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 * ? Original verison KKD 88/??/??
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 * 4 Modified by Ken Drexler fr various block sizes KD 89/07/30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 nam MMap
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 ttl Memory Block Utility
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 Revs set ReEnt+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 Type set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 edition set 4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 mod prglen,name,type,revs,MMap,datsiz
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 Name fcs /MMap/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 ***************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 * Data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 buffsiz set 512
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 numflag rmb 1 flag for leading zeros
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 rowcnt rmb 1 no rows to print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 free rmb 1 no free blocks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 rowno rmb 1 row number
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 lcnt rmb 1 line length counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 outptr rmb 2 output pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 out rmb 80 output buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 mapsiz rmb 2 size of map block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 blksiz rmb 2 block size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 buffer rmb buffsiz map itself
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 stack rmb 200
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 datsiz equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 pag
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 ***************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 * Messages
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 header fcc / 0 1 2 3 4 5 6 7 8 9 A B C D E F/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 fcb C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 hdrlen equ *-header
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 hdr2 fcc / # = = = = = = = = = = = = = = = =/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 fcb C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 hdrlen2 equ *-hdr2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 BlockMsg fcc / Block Size: /
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 blklen equ *-Blockmsg
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 Freemsg fcc / Free Blocks: /
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 freelen equ *-Freemsg
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 Rammsg fcc / KBytes Free: /
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 ramlen equ *-Rammsg
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 **********************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 MMap lbsr pcrtn print line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 leax header,pcr print headers
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 lda #1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 ldy #hdrlen
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 leax hdr2,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 ldy #hdrlen2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 leax buffer,u get block map to read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 os9 F$GBlkMp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 lbcs error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 std blksiz save block size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 sty mapsiz save map size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 clr free
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 clr rowno
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 ldd mapsiz compute number of rows
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 lsra at 16 per row
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 stb rowcnt save count
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 leax out,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 stx outptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 leax buffer,u point at map
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 bra loop2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 loop dec lcnt count -= 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 bne loop3 if more, skip line print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 * print line, start next line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 loop1 pshs x save map pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 lbsr prline print line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 dec rowcnt done?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 beq exit yes
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 loop2 lda #16 set line length count
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 sta lcnt
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 lbsr Space 1 space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 lda rowno print row number
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 lbsr Hex1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 inc rowno row number += 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 lbsr space2 2 spaces
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 * Print one block status
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 loop3 ldb ,x+ get next block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 beq freeram
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 bmi noram
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 bitb #2 module?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 bne module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 lda #'U must be ram in use
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 bra put
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 freeram lda #'_ not used
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 inc free count it
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 bra put
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 module lda #'M module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 bra put
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 noram lda #'. not ram
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 * Print character in A and space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 put equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 lbsr print put character in output buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 lda #C$SPAC add space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 lbsr print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 bra loop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 * Add summary messages
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 Exit equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 leax BlockMsg,pcr print "Block Size"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 ldy #blklen
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 lbsr Prstr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 ldd blksiz
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 clr numflag suppress zeros
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 bsr outdec
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 lbsr prline print line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 leax freemsg,pcr print "Free Blocks"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 ldy #freelen
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 lbsr Prstr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 ldb free get number of blocks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 clr numflag suppress zeros
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 bsr outdec print in decimal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 bsr prline
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 leax rammsg,pcr print "Ram Free"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 ldy #ramlen
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 lbsr Prstr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 ldb free get number of blocks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 lda blksiz get #k/block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 lsra by dividing msb by 4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 clr numflag suppress zeros
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 bsr outdec print in decimal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 bsr prline
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 bye clrb no errors
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 error os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 **********************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 * Subroutines
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 Pcrtn pshs a,x Output carriage return
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 lda #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 sta out
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 leax out,u point at buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 ldy #1 one char.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 lda #1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 puls a,x,pc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 ** Decimal output routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 * IN: D - number to output
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 * X - destination buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 * OUT: X,Y,U preserved
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 Outdec pshs b,x,y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 ldx outptr get pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 leau <dectbl,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 ldy #5 set counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 Outdec1 clr ,s clear workspace
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 Outdec2 subd ,u subtract power of ten
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 bcs outdec3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 inc ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 bra outdec2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 outdec3 addd ,u++ add back one power
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 pshs b save b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 ldb 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 addb #'0 convert to ascii
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 cmpb #'0 zero?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 bne outdec4 no, print it
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 tst numflag suppress zero?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 beq outdec5 yes
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 outdec4 inc numflag
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 stb ,x+ put in buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 outdec5 puls b restore b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 leay -1,y counter -= 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 bne outdec1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 stx outptr update pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 puls b,x,y,u,pc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 Dectbl fdb 10000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 fdb 1000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 fdb 100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 fdb 10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 fdb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 * Print Line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 Prline ldx outptr now print line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 lda #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 sta ,x terminate line
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 leax out,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 ldy #80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 lda #1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 os9 I$Writln
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 bcs error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 leax out,u set pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 stx outptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 * Print Spaces
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 Space2 bsr Space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 Space lda #C$SPAC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 bra Print
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 * Print Hexidecimal Digit in A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 Hex1 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 lsra
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 bsr outhex
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 tfr b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 Outhex anda #$0f
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 cmpa #$0a 0 - 9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 bcs outdig
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 adda #$07 A - F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 outdig adda #'0 make ASCII
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 print pshs X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 ldx outptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269 sta ,X+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 stx outptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 puls x,pc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 * Print string to output buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 * IN: X - string pointer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 * Y - string length
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 Prstr equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 lda ,x+ get character
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 bsr print put in buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 leay -1,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 bne Prstr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 Prglen equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 end