1524
|
1 ********************************************************************
|
|
2 * DMode - Disk descriptor utility
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * RBF descriptor utility similar to xmode.
|
|
7 * Use: dmode </devicename> [options]
|
|
8 * dmode -<filename> [options]
|
|
9 * (allows dmode use on a saved desc)
|
|
10 * (-filename will use data dir for default)
|
|
11 * dmode -? will give bit definitions
|
|
12 * If no options given, just returns desc info.
|
|
13 * All numbers must be in HEX.
|
|
14 * dmode
|
|
15 * dmode /h0 cyl=0200 sas=8 ilv=4
|
|
16 * dmode /d0
|
|
17 * dmode -?
|
|
18 * dmode -/d1/modules/d2.dd cyl=0028
|
|
19 *
|
|
20 * Edt/Rev YYYY/MM/DD Modified by
|
|
21 * Comment
|
|
22 * ------------------------------------------------------------------
|
|
23 * 1986/09/23 Kevin Darling
|
|
24 * Oversized and kludgy, but works.
|
|
25 * Apologies for lack of comments.
|
|
26 *
|
|
27 * 1986/10/01 Kevin Darling
|
|
28 *
|
|
29 * 1986/10/02 Kevin Darling
|
|
30 * This version will do desc file on disk also.
|
|
31 *
|
|
32 * 1989/08/24 Roger A. Krupski (HARDWAREHACK)
|
|
33 * Fixed "lower case bug", allowed "$" prefix for hex
|
|
34 *
|
|
35 * -------- NitrOS9 DMODE HISTORY -----------------------------------
|
|
36 * 8 / 1 2003/01/31 Boisy G Pitre
|
|
37 * Initial import - added to standard CMDS distribution
|
|
38 *
|
|
39 * 8 / 1 2003/09/04 Boisy G Pitre
|
|
40 * Redid history comments to new format
|
|
41 *
|
|
42 * 1 / 4 2004/02/19 Boisy G Pitre
|
|
43 * Old source replaced by fcb hex dump of new dmode.bin
|
|
44 * May be a back-port from Carl Kreider's dmode for OSK
|
|
45 *
|
|
46 * 2 / 4 2004/02/28 Rodney V. Hamilton
|
|
47 * Disassembled new dmode, added comments and KD/RAK mods.
|
963
|
48
|
1524
|
49 nam DMode
|
|
50 ttl program module
|
|
51
|
|
52 * Disassembled 2004/02/21 08:59:24 by Disasm v1.5 (C) 1988 by RML
|
|
53
|
|
54 IFP1
|
|
55 use defsfile
|
|
56 ENDC
|
|
57
|
|
58 tylg set Prgrm+Objct
|
|
59 atrv set ReEnt+rev
|
|
60 rev set $04
|
|
61
|
|
62 mod eom,name,tylg,atrv,start,size
|
|
63
|
|
64 OLDMODS equ 1 enable KD/RAK dmode mods if >0
|
|
65
|
|
66 hexcnt rmb 1 number of option bytes
|
|
67 dataptr rmb 2 current option ptr
|
|
68 hexin rmb 2 2 byte hex number
|
|
69 module rmb 2 desc address
|
|
70 msize rmb 2 module total size (including CRC)
|
|
71 dsize rmb 2 descriptor size (hdrs + init tbl)
|
|
72 parmptr rmb 2 next name dataptr
|
|
73 path rmb 1 file path
|
|
74 txtptr rmb 2 option name ptr
|
|
75 buffer rmb 10 output buffer
|
|
76 buflen equ .-buffer
|
|
77 desc rmb 80
|
|
78 descmax equ .-desc
|
|
79 rmb 512 stack+params
|
|
80 size equ .
|
|
81
|
|
82 name fcs /DMode/
|
|
83 fcb $02
|
|
84
|
|
85 ** Options Table for RBF Device Driver Modules
|
|
86 * entry format: NAME[4] + OFFSET[1] + COUNT[1]
|
|
87 * NAME: leading space plus 3-char field name
|
|
88 * OFFSET: byte offset to option field in module
|
|
89 * COUNT: size of option field in bytes
|
|
90 ** (if offset bit.7 set, field is ptr to string of length COUNT)
|
|
91 otable fcc " nam"
|
|
92 fcb M$Name!$80 ($84) ptr to name of module
|
|
93 fcb 3 max name length=3
|
|
94 nxtopt equ *-otable offset to next option (=6)
|
|
95 optlen equ nxtopt-2 length of option name (=4)
|
|
96 optoff equ nxtopt-2 offset to option offset (=4)
|
|
97 optsiz equ nxtopt-1 offset to option byte count (-5)
|
|
98 fcc " mgr"
|
|
99 fcb M$FMgr+$80,0 ($89) ptr to name of file manager
|
|
100 fcc " ddr"
|
|
101 fcb M$PDev-$80,0 ($8B) ptr to name of device driver
|
|
102 fcc " hpn"
|
|
103 fcb M$Port,1 ($0E) extended port address
|
|
104 fcc " hpa"
|
|
105 fcb M$Port+1,2 ($0F) base port address
|
|
106 fcc " drv"
|
|
107 fcb IT.DRV,1 ($13) drive number
|
|
108 fcc " stp"
|
|
109 fcb IT.STP,1 ($14) step rate
|
|
110 fcc " typ"
|
|
111 fcb IT.TYP,1 ($15) device type
|
|
112 fcc " dns"
|
|
113 fcb IT.DNS,1 ($16) media density
|
|
114 fcc " cyl"
|
|
115 fcb IT.CYL,2 ($17) number of cylinders (tracks)
|
|
116 fcc " sid"
|
|
117 fcb IT.SID,1 ($19) number of sides
|
|
118 fcc " vfy"
|
|
119 fcb IT.VFY,1 ($1A) verify writes (0-yes)
|
|
120 fcc " sct"
|
|
121 fcb IT.SCT,2 ($1B) default sectors/track
|
|
122 fcc " t0s"
|
|
123 fcb IT.T0S,2 ($1D) default sect/trk for track 0
|
|
124 fcc " ilv"
|
|
125 fcb IT.ILV,1 ($1F) sector interleave factor
|
|
126 fcc " sas"
|
|
127 fcb IT.SAS,1 ($20) minimum segment allocation (sectors)
|
|
128 fcc " wpc"
|
|
129 fcb $25,1 (offset unnamed) write precomp cylinder (HD)
|
|
130 fcc " ofs"
|
|
131 fcb $26,2 (offset unnamed) starting cylinder offset (HD)
|
|
132 fcc " rwc"
|
|
133 fcb $28,2 (offset unnamed) reduced write current cylinder (HD)
|
|
134 otblsiz equ (*-otable)/nxtopt
|
|
135 * number of DISPLAYED options - remainder are accepted but not printed
|
|
136 IFNE OLDMODS compatibility
|
|
137 fcc " tos" alias for t0s (old DMODE compatibility)
|
|
138 fcb IT.T0S,2
|
|
139 ENDC
|
|
140 fcb $80 end of table
|
|
141
|
|
142 usage fcb C$LF
|
|
143 fcc "Usage: DMode [/<device> || -<pathlist> || -?] [option] [option] [...]"
|
|
144 fcb C$LF
|
|
145 fcb C$LF
|
|
146 fcc "Purpose: To report or alter current option settings of RBF device"
|
|
147 fcb C$LF
|
|
148 fcc " descriptors in memory or on disk in single module files."
|
|
149 fcb C$LF
|
|
150 fcb C$LF
|
|
151 fcc "Options: nam, mgr, ddr, hpn, hpa, drv, stp, typ, dns, cyl, sid, vfy,"
|
|
152 fcb C$LF
|
|
153 fcc " sct, t0s, ilv, sas, wpc, ofs, rwc."
|
|
154 fcb C$LF
|
|
155 fcb C$LF
|
|
156 fcc "Examples: dmode /dd"
|
|
157 fcb C$LF
|
|
158 fcc " Prints the current option settings of the /DD descriptor"
|
|
159 fcb C$LF
|
|
160 fcc " in memory."
|
|
161 fcb C$LF
|
|
162 fcc " dmode -modules/h0.dd nam=H1 drv=1 cyl=03FF rwc=ffff"
|
|
163 fcb C$LF
|
|
164 fcc " Changes the module name in the MODULES/H0.dd file to H1,"
|
|
165 fcb C$LF
|
|
166 fcc " sets the physical drive number to 1, cylinders to $03FF,"
|
|
167 fcb C$LF
|
|
168 fcc " and the Reduced Write Current cylinder to $FFFF."
|
|
169 fcb C$LF
|
|
170 fcc " dmode -?"
|
|
171 fcb C$LF
|
|
172 fcc " Prints more complete information on all of the options."
|
|
173 fcb C$CR
|
|
174 uselen equ *-usage
|
|
175
|
|
176 infomsg fcb C$LF
|
|
177 fcc "The NAM option accepts only a legal OS-9 module name with a maximum of"
|
|
178 fcb C$LF
|
|
179 fcc "3 characters. It is up to the user to ensure that there is adequate"
|
|
180 fcb C$LF
|
|
181 fcc "room for the module name, and if required to rename the disk file to"
|
|
182 fcb C$LF
|
|
183 fcc "suit the new module name. The MGR and DDR options can't be changed."
|
|
184 fcb C$LF
|
|
185 fcc "All other options require hexadecimal numbers (0 through FFFF). The"
|
|
186 fcb C$LF
|
|
187 fcc "WPC, OFS, and RWC options are for WDDisk descriptors only."
|
|
188 fcb C$LF
|
|
189 fcb C$LF
|
|
190 fcc "nam Device Descriptor Name "
|
|
191 fcc "mgr File Manager Name"
|
|
192 fcb C$LF
|
|
193 fcc "ddr Device Driver Name "
|
|
194 fcc "hpn Hardware Page Number"
|
|
195 fcb C$LF
|
|
196 fcc "hpa Hardware Port Address "
|
|
197 fcc "drv Physical Drive Number"
|
|
198 fcb C$LF
|
|
199 fcc "stp Step Rate Code "
|
|
200 fcc "typ Drive Type"
|
|
201 fcb C$LF
|
|
202 fcc "dns Drive/Disk Density "
|
|
203 fcc "cyl Drive Cylinders"
|
|
204 fcb C$LF
|
|
205 fcc "sid Drive Sides (Heads) "
|
|
206 fcc "vfy Write Verify Flag"
|
|
207 fcb C$LF
|
|
208 fcc "sct Sectors Per Track "
|
|
209 fcc "t0s Sectors On Track Zero"
|
|
210 fcb C$LF
|
|
211 fcc "ilv Sector Interleave Factor "
|
|
212 fcc "sas Segment Allocation Size"
|
|
213 fcb C$LF
|
|
214 fcc "wpc Write Precompensation Code "
|
|
215 fcc "ofs Partition Offset Cylinder"
|
|
216 fcb C$LF
|
|
217 fcc "rwc Reduced Write Current Cylinder"
|
|
218 fcb C$CR
|
|
219 infolen equ *-infomsg
|
|
220
|
|
221 equal fcb $3D "="
|
|
222
|
|
223 rbfmsg fcb C$LF
|
|
224 fcc "Not an RBF descriptor!"
|
|
225 cr fcb C$CR
|
|
226 rbflen equ *-rbfmsg
|
|
227
|
|
228 sizmsg fcb C$LF
|
|
229 fcc "Module size out of range!"
|
|
230 fcb C$CR
|
|
231 sizlen equ *-sizmsg
|
|
232
|
|
233 synmsg fcb C$LF
|
|
234 fcc "Syntax error: "
|
|
235 synlen equ *-synmsg
|
|
236
|
|
237 *NOTE: --the code begins here--
|
|
238
|
|
239 morehelp leax >infomsg,pcr
|
|
240 ldy #infolen
|
|
241 bra helpprnt
|
|
242
|
|
243 toobig leax >sizmsg,pcr
|
|
244 ldy #sizlen
|
|
245 bra errprnt
|
|
246
|
|
247 notrbf leax >rbfmsg,pcr
|
|
248 ldy #rbflen
|
|
249
|
|
250 errprnt lda #2
|
|
251 os9 I$WritLn
|
|
252
|
|
253 help leax >usage,pcr
|
|
254 ldy #uselen
|
|
255
|
|
256 helpprnt lda #2
|
|
257 os9 I$WritLn
|
|
258 lbra okayend2
|
|
259
|
|
260 start equ *
|
|
261 ldd #0
|
|
262 std <module zero mod flag
|
|
263 sta <path zero file flag
|
|
264 ldd ,x+ check for device name
|
|
265 cmpa #'- file option?
|
|
266 bne link
|
|
267 cmpb #'? help option?
|
|
268 beq morehelp
|
|
269
|
|
270 * read descriptor from file
|
|
271 lda #UPDAT. open path to desc file
|
|
272 os9 I$Open
|
|
273 bcs help
|
|
274 stx <parmptr
|
|
275 sta <path save path number
|
|
276 ldy #descmax max size
|
|
277 leax <desc,u desc buff
|
|
278 os9 I$Read read the file
|
|
279 lbcs error
|
|
280 ldb <M$Opt,x init table size
|
|
281 clra
|
|
282 addd #M$DTyp add size of headers
|
|
283 std <dsize save desc size less CRC
|
|
284 ldd M$Size,x module size incl CRC
|
|
285 cmpd #descmax too big for desc buffer?
|
|
286 bhi toobig ..yes, size error
|
|
287 std <msize save module size
|
|
288 bra gotit
|
|
289
|
|
290 * read descriptor from memory
|
|
291 link cmpa #PDELIM else must be /<devicename>
|
|
292 bne help
|
|
293 pshs u
|
|
294 lda #Devic type=device descriptor
|
|
295 os9 F$Link link to descriptor
|
|
296 bcs help
|
|
297 stx <parmptr update after name
|
|
298 tfr u,x
|
|
299 puls u
|
|
300 stx <module
|
|
301 ldb <M$Opt,x get desc init table size
|
|
302 clra
|
|
303 addd #M$DTyp add desc header size
|
|
304 std <dsize save desc size less CRC
|
|
305 ldd M$Size,x get current module size
|
|
306 cmpd #descmax too big for desc buffer?
|
|
307 lbhi toobig ..yes, size error
|
|
308 std <msize save module size
|
|
309 tfr d,y
|
|
310 pshs u
|
|
311 leau <desc,u
|
|
312 mloop lda ,x+ copy in-memory data
|
|
313 sta ,u+ to descriptor buffer
|
|
314 leay -1,y
|
|
315 bne mloop
|
|
316 puls u
|
|
317 gotit ldd <dsize
|
|
318 cmpd <msize
|
|
319 lbcc toobig
|
|
320 leax <desc,u
|
|
321 lda <IT.DTP,x test device type
|
|
322 cmpa #1 RBF?
|
|
323 lbne notrbf .. no, non-RBF error
|
|
324 ldx <parmptr reload input parms ptr
|
|
325 lbsr skipspc skip blanks
|
|
326 cmpa #C$CR any options?
|
|
327 lbeq info ..no, give current info
|
|
328 leax -1,x else find options
|
|
329
|
|
330 * Find and Set Options
|
|
331 * X=param ptr
|
|
332 findopt lbsr skipspc get next input param
|
|
333 stx <parmptr save for syntax error use
|
|
334 cmpa #C$CR end?
|
|
335 lbeq verify ..yes, update desc CRC
|
|
336 leay >(otable-nxtopt),pcr init option table ptr
|
|
337 pshs u
|
|
338 ldu ,x++ get next two chars
|
|
339 ora #'a-'A force lowercase char 1
|
|
340 exg d,u
|
|
341 ora #'a-'A -ditto for chars 2&3
|
|
342 orb #'a-'A
|
|
343 exg d,u
|
|
344 flup20 leay nxtopt,y next option entry
|
|
345 tst ,y end of table?
|
|
346 bmi syntax ..yes, bad option
|
|
347 cmpa 1,y
|
|
348 bne flup20 option name match?
|
|
349 cmpu 2,y
|
|
350 bne flup20 ..no, try next
|
|
351 * option found
|
|
352 puls u
|
|
353 sty <txtptr
|
|
354 ldd ,x+
|
|
355 cmpa #'= must be followed by "="
|
|
356 bne syntax
|
|
357 cmpb #C$CR
|
|
358 beq syntax
|
|
359 cmpb #C$SPAC
|
|
360 beq syntax
|
|
361 ldb optsiz,y get # of bytes
|
|
362 beq syntax cannot modify if length=0
|
|
363 stb <hexcnt
|
|
364 ldb optoff,y get option size/type
|
|
365 bpl setnum hi-bit clear, do numeric
|
|
366 * process string option change
|
|
367 andb #$7F get string ptr offset
|
|
368 clra
|
|
369 cmpd <msize within module?
|
|
370 bcc syntax
|
|
371 leay <desc,u
|
|
372 ldd b,y read string ptr
|
|
373 cmpd <msize within module?
|
|
374 bcc syntax
|
|
375 leay d,y point to string field
|
|
376 pshs y
|
|
377 os9 F$PrsNam parse user's input for valid OS9 name
|
|
378 puls y
|
|
379 bcs syntax bad name syntax
|
|
380 cmpa #C$SPAC name's trailing delimiter..
|
|
381 beq nameok must be space
|
|
382 cmpa #C$CR or end of line
|
|
383 bne syntax
|
|
384 nameok cmpb <hexcnt new name longer than field size?
|
|
385 bhi syntax
|
|
386 ncopy lda ,x+ copy new name to desc
|
|
387 sta ,y+
|
|
388 decb
|
|
389 bne ncopy
|
|
390 lda -1,y
|
|
391 ora #$80 and flag last char
|
|
392 sta -1,y
|
|
393 lbra findopt
|
|
394
|
|
395 syntax leax >synmsg,pcr
|
|
396 ldy #synlen
|
|
397 lda #2
|
|
398 os9 I$Write print syntax err msg to stderr
|
|
399 ldx <parmptr
|
|
400 leax -1,x rewind to start of arg
|
|
401 pshs x
|
|
402 ldy #0 set arg len to 0
|
|
403 slup leay 1,y ..count chars
|
|
404 lda ,x+
|
|
405 cmpa #C$CR ..until EOL
|
|
406 beq synsay
|
|
407 cmpa #C$SPAC ..or space
|
|
408 bne slup
|
|
409 synsay puls x X=arg ptr, Y=arg len
|
|
410 lda #2
|
|
411 os9 I$Write print name of bad arg to stderr
|
|
412 lbra okayend
|
|
413
|
|
414 * process numeric option change
|
|
415 setnum clra
|
|
416 cmpd <dsize option within current descriptor?
|
|
417 bcc syntax
|
|
418 clr <hexin zero hex input field
|
|
419 clr <hexin+1
|
|
420
|
|
421 setloop lda ,x+ get next #
|
|
422 IFNE OLDMODS compatibility
|
|
423 cmpa #'$ optional hex $?
|
|
424 beq setloop yes, ignore
|
|
425 ENDC
|
|
426 cmpa #C$SPAC end of number?
|
|
427 beq setnum2 ..yes, set option, rts
|
|
428 cmpa #C$CR end of line?
|
|
429 beq setnum1
|
|
430 * hex conversion - inlined code
|
|
431 suba #'0 make number from ASCII
|
|
432 bmi syntax
|
|
433 cmpa #10 is it number?
|
|
434 bcs num
|
|
435 anda #$5F make uppercase
|
|
436 suba #'A-'0-10 make hex $A-$F
|
|
437 cmpa #10 not hex char?
|
|
438 bcs syntax
|
|
439 cmpa #16 not hex char?
|
|
440 bcc syntax
|
|
441 num ldb #16 fancy asl *4
|
|
442 mul
|
|
443 pshs b save top 4 bits
|
|
444 ldd <hexin
|
|
445 rol ,s
|
|
446 rolb
|
|
447 rola
|
|
448 rol ,s
|
|
449 rolb
|
|
450 rola
|
|
451 rol ,s
|
|
452 rolb
|
|
453 rola
|
|
454 rol ,s
|
|
455 rolb
|
|
456 rola
|
|
457 std <hexin
|
|
458 puls b
|
|
459 bra setloop ..loop
|
|
460
|
|
461 setnum1 leax -1,x reset so can find <cr>
|
|
462 setnum2 ldb optoff,y get option offset
|
|
463 leay <desc,u point to desc
|
|
464 leay b,y point to option
|
|
465 ldd <hexin pick up hex input
|
|
466 dec <hexcnt
|
|
467 beq setone
|
|
468 std ,y set two byte option
|
|
469 lbra findopt
|
|
470
|
|
471 setone tsta
|
|
472 lbne syntax
|
|
473 stb ,y set one byte option
|
|
474 lbra findopt
|
|
475
|
|
476 skipspc lda ,x+
|
|
477 cmpa #C$SPAC
|
|
478 beq skipspc
|
|
479 rts
|
|
480
|
|
481 * Update Descriptor's CRC
|
|
482 verify pshs u
|
|
483 leau <desc,u
|
|
484 tfr u,x X is module addr
|
|
485 ldy M$Size,x Y is module size
|
|
486 leay -3,y offset of CRC
|
|
487 tfr y,d Y is byte count
|
|
488 leau d,u U is ptr to CRC
|
|
489 lda #$FF init CRC value
|
|
490 sta 0,u
|
|
491 sta 1,u
|
|
492 sta 2,u
|
|
493 pshs u
|
|
494 os9 F$CRC calc new CRC
|
|
495 puls u
|
|
496 com ,u+ store as complement
|
|
497 com ,u+
|
|
498 com ,u
|
|
499 lda <path was it a file?
|
|
500 beq memmod ..no, in memory
|
|
501 ldx #0
|
|
502 tfr x,u
|
|
503 os9 I$Seek go back to file begin
|
|
504 bcs error
|
|
505 puls u
|
|
506 leax <desc,u
|
|
507 ldy <msize
|
|
508 os9 I$Write update desc file
|
|
509 bra okayend
|
|
510
|
|
511 memmod ldu ,s
|
|
512 leax <desc,u
|
|
513 ldy <msize
|
|
514 ldu <module
|
|
515 move lda ,x+
|
|
516 sta ,u+
|
|
517 leay -1,y
|
|
518 bne move
|
|
519 puls u
|
|
520 bra okayend2
|
|
521
|
|
522 okayend bsr outcr
|
|
523 okayend2 clrb
|
|
524 error pshs b,cc
|
|
525 ldu <module
|
|
526 beq bye
|
|
527 os9 F$UnLink
|
|
528 bye puls b,cc
|
|
529 os9 F$Exit end dmode.
|
|
530
|
|
531 outcr leax >cr,pcr
|
|
532 ldy #1
|
|
533 lda #1
|
|
534 os9 I$WritLn
|
|
535 rts
|
|
536
|
|
537 * Output Current Desc Info
|
|
538 info bsr outcr
|
|
539 ldb #otblsiz printable entry count
|
|
540 pshs b
|
|
541 leax >otable,pcr point to option table
|
|
542 stx <txtptr
|
|
543 ilup ldx <txtptr
|
|
544 ldy #optlen
|
|
545 lbsr output print option name
|
|
546 leax >equal,pcr
|
|
547 ldy #1
|
|
548 lbsr output and '='
|
|
549 ldx <txtptr
|
|
550 ldb optoff,x get option type & size
|
|
551 bpl outnum if numeric, print hex value
|
|
552 * Print String Option Field
|
|
553 andb #$7F else get string ptr offset
|
|
554 clra
|
|
555 cmpd <msize within module?
|
|
556 bcc inext ..no, skip to next option
|
|
557 leay <desc,u
|
|
558 ldd b,y read string ptr
|
|
559 cmpd <msize within module?
|
|
560 bcc inext ..no, skip to next option
|
|
561 leay d,y point to string field
|
|
562 lda #buflen
|
|
563 leax <buffer,u
|
|
564 clr <hexcnt
|
|
565 sloop ldb ,y+ copy string chars
|
|
566 bpl scopy last char?
|
|
567 andb #$7F ..yes, make printable
|
|
568 lda #1 ..and set exit count
|
|
569 scopy stb ,x+ to output buffer
|
|
570 inc <hexcnt counting as we go
|
|
571 deca
|
|
572 bne sloop until buffer full
|
|
573 ldb <hexcnt get length copied
|
|
574 tfr d,y
|
|
575 leax <buffer,u
|
|
576 bsr output print the string
|
|
577 bra inext goto next option
|
|
578
|
|
579 * Print Numeric Option Value
|
|
580 outnum ldx <txtptr
|
|
581 ldb optsiz,x get # of bytes
|
|
582 stb <hexcnt
|
|
583 ldb optoff,x get field offset
|
|
584 clra
|
|
585 cmpd <dsize within descriptor?
|
|
586 bcc inext no, skip to next
|
|
587 leax <desc,u
|
|
588 abx point to number
|
|
589 stx <dataptr
|
|
590 * print <hexcnt> bytes starting at [x] as ASCII Hex
|
|
591 outhex ldx <dataptr
|
|
592 lda ,x+ get next byte
|
|
593 stx <dataptr
|
|
594 pshs a print as 2 hex digits
|
|
595 lsra
|
|
596 lsra
|
|
597 lsra
|
|
598 lsra
|
|
599 bsr outone print upper
|
|
600 puls a
|
|
601 anda #$0F
|
|
602 bsr outone print lower
|
|
603 dec <hexcnt
|
|
604 bne outhex
|
|
605 inext ldx <txtptr
|
|
606 leax nxtopt,x point to next option
|
|
607 stx <txtptr
|
|
608 dec ,s continue until
|
|
609 lbeq okayend ..end of printable info
|
|
610 ldb ,s if option counter
|
|
611 bitb #$07 ..is a multiple of 8
|
|
612 lbne ilup
|
|
613 lbsr outcr do a <cr>
|
|
614 lbra ilup ..and continue
|
|
615
|
|
616 outone cmpa #10 Print 1/2 Byte Hex Char:
|
|
617 bcs number
|
|
618 adda #$11-10 make alpha
|
|
619 number adda #'0 make ASCII
|
|
620 sta <buffer
|
|
621 leax <buffer,u
|
|
622 ldy #1 print one digit
|
|
623 output lda #1
|
|
624 os9 I$Write print the output buffer
|
|
625 lbcs error
|
|
626 rts
|
|
627
|
|
628 emod
|
|
629 eom equ *
|
|
630 end
|