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

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