annotate level2/cmds/mdir.asm @ 1487:97b3df00ef37

nil now part of vrn
author boisy
date Mon, 22 Dec 2003 21:59:00 +0000
parents 8e90ef1b670e
children f8a9b569045a
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 * MDir - Show module 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 *
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 839
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
bf6f854a4299 Changed revisions to 0
boisy
parents: 839
diff changeset
7 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
9 * 7 ????/??/??
1350
8e90ef1b670e Rolled into Level 1 unlink.asm
boisy
parents: 1277
diff changeset
10 * Original Tandy/Microware version.
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 839
diff changeset
11 *
bf6f854a4299 Changed revisions to 0
boisy
parents: 839
diff changeset
12 * 8 2003/01/14 Boisy Pitre
bf6f854a4299 Changed revisions to 0
boisy
parents: 839
diff changeset
13 * Changed option to -e, optimized slightly. Could use greater optimization.
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
14 *
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
15 * 9 2003/08/24 Rodney Hamilton
1350
8e90ef1b670e Rolled into Level 1 unlink.asm
boisy
parents: 1277
diff changeset
16 * Corrected leading zero supression, more optimizations.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 nam MDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 ttl Show module information
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 * Disassembled 98/09/11 11:57:27 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 atrv set ReEnt+rev
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 839
diff changeset
29 rev set $00
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
30 edition set 9
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
34 ParamPtr rmb 2
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
35 zflag rmb 1 supress leading zeros flag
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
36 bufptr rmb 2 current position in the line buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
37 datebuf rmb 3
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
38 timebuf rmb 3
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
39 narrow rmb 1
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
40 u000C rmb 1 name field width
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
41 u000D rmb 1 last starting column
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
42 linebuf rmb 80
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
43 u005E rmb 2 ptr to module dir end
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
44 u0060 rmb 2 ptr to module dir start
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 u0062 rmb 4096
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
46 u1062 rmb 64 module name buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
47 u10A2 rmb 13 module stats ??
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
48 rmb 256 stack area
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 name fcs /MDir/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
54 header fcs " Module Directory at "
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
55 header2 fcs "Block Offset Size Typ Rev Attr Use Module Name"
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
56 header3 fcs "----- ------ ---- --- --- ---- ---- ------------"
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
57 sheader1 fcs "Blk Ofst Size Ty Rv At Uc Name"
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
58 sheader2 fcs "___ ____ ____ __ __ __ __ ______"
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
59 lock fcs "Lock "
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
60 slock fcs "Lk"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 start pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 leau >u1062,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 L00D4 clr ,-u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 cmpu ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 bhi L00D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 puls u
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
68 clr <zflag clear leading zero supression
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
69 clr <narrow default to wide
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
70 ldd #$0C30 wide column width=12/last start col=48
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 std <u000C
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
72 stx <ParamPtr save args ptr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
73 leax linebuf,u
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
74 stx <bufptr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
75 lbsr writeBUF
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
76 lda #$01 standard output
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
77 ldb #SS.ScSiz get size of screen
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
78 os9 I$GetStt get it!
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
79 bcc L00FF branch if ok
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
80 cmpb #E$UnkSvc unknown service?
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
81 lbne L0241 exit with error if not
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
82 bra L010C else ignore screen width test
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
83
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
84 L00FF cmpx #50 compare against 50
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
85 bge L010C if greater or equal, go on
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
86 inc <narrow else set narrow flag
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
87 ldd #$0A15 narrow column width=10/last start col=21
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 std <u000C
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
89 L010C leay >header,pcr point to main header
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
90 lbsr copySTR
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
91 leax datebuf,u date/time buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
92 os9 F$Time get current date & time
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
93 leax timebuf,u only wanted the time
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
94 lbsr L02B8 print TIME as HH:MM:SS
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
95 lbsr writeBUF
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
96 leax <u0062,u buffer for module directory
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 pshs u
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
98 os9 F$GModDr get module directory
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
99 sty <u005E save local end ptr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
100 stu <u0060 save system start ptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 puls u
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
102 leax -MD$ESize,x
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
103 ldy <ParamPtr
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
104 ldd ,y+
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
105 andb #$DF
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
106 cmpd #$2D45 -e option?
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 bne L018E
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
108 lbsr writeBUF
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
109 L0149 leay >header2,pcr
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
110 tst <narrow
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
111 beq L014D
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
112 leay >sheader1,pcr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
113 L014D lbsr copySTR
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
114 lbsr writeBUF
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
115 L015D leay >header3,pcr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
116 tst <narrow
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
117 beq L0161
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
118 leay >sheader2,pcr
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
119 L0161 lbsr copySTR
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
120 lbsr writeBUF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 leax <u0062,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 lbra L023A
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
123
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
124 * just print the module names, no E flag
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 L016D lbsr L0308
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 beq L018E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 lbsr L02DE
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
128 lbsr copySTR
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
129 L0178 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
130 ldb <bufptr+1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 subb #$0E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 cmpb <u000D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 bhi L018B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 L0183 subb <u000C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 bhi L0183
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 bne L0178
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 bra L018E
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
138
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
139 L018B lbsr writeBUF
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
140 L018E leax MD$ESize,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 cmpx <u005E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 bcs L016D
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
143 lbsr writeBUF final/partial line
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
144 lbra L0240 exit OK
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
145
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
146 * print extended info line for each module
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 L019A lbsr L0308
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
148 lbeq L0238 skip if DAT image ptr==0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 ldd ,y
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
151 tst <narrow
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 beq L01B1
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
153 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
154 lbsr outb2HS 2-digit block number
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
155 bra L01BE
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
156 L01B1 lbsr out4HS 4-digit block number
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
157 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
158 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
159 * module offset
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
160 L01BE ldd MD$MPtr,x
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
161 bsr out4HS 4-digit offset
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
162 tst <narrow
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 bne L01CA
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
164 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
165 L01CA lbsr L02DE read module's header info
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 leay >u10A2,u
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
167 * module size
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
168 ldd M$Size,y
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
169 bsr out4HS 4-digit size
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
170 tst <narrow
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 bne L01DC
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
172 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
173 * type/lang
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
174 L01DC lda M$Type,y
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
175 bsr out2HS 2-digit type/lang
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
176 tst <narrow
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 bne L01E7
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
178 lbsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
179 * att/rev
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
180 L01E7 lda M$Revs,y
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
181 anda #RevsMask
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
182 bsr out2HS 2-digit revision
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
183 ldb M$Revs,y upper half = attributes
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
184 lda #'r
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
185 bsr L0291 bit7: ReEnt (reentrant module)
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
186 tst <narrow
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 bne L0207
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
188 lda #'w bit6: ModProt (writeable module)
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
189 bsr L0291
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
190 lda #'3 bit5: ModNat (native mode 6309)
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
191 bsr L0291
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
192 lda #'? bit4 undefined
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
193 bsr L0291
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
194 * user count
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
195 L0207 bsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
196 ldd MD$Link,x D=user count
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
197 cmpd #$FFFF if -1,
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 bne L0223
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
199 L021B leay >lock,pcr print "Lock"
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
200 tst <narrow
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
201 bne L021F
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
202 leay >slock,pcr
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
203 L021F bsr copySTR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 bra L0230
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
205
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
206 L0223 tst <narrow
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 beq L022E
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
208 bsr outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
209 bsr outb2HS 2-digit user count
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 bra L0230
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
211
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
212 L022E bsr out4HS 4-digit user count
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
213 * module name
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
214 L0230 leay >u1062,u point to name buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
215 bsr copySTR
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
216 bsr writeBUF
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
217 L0238 leax MD$ESize,x next entry
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
218 L023A cmpx <u005E more to do?
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
219 lbcs L019A yes, continue
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 L0240 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 L0241 os9 F$Exit
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
222
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
223 * print regD as 4 hex digits plus space
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
224 out4HS inc <zflag supress leading zeros
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
225 inc <zflag
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
226 bsr out2H print MSB as 2 hex
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
227 dec <zflag
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
228 * print regB as 2 hex digits plus space
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
229 outb2HS tfr b,a print LSB as 2 hex
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
230
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
231 * print regA as 2 hex digits plus space
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
232 out2HS bsr out2H
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
233 bra outSP
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
234
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
235 out2H inc <zflag supress leading zero
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
236 pshs a
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 lsra
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
241 bsr L026C print MSdigit
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
242 puls a print LSdigit
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
243 anda #$0F is this a zero?
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
244 L026C bne L027B no, print it
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
245 tst <zflag still supressing zeros?
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
246 bgt outZSP yes, count it and print space
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
247 L027B clr <zflag nonzero, print all the rest
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
248 adda #'0
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
249 cmpa #'9
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
250 bls outCH
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 adda #$07
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
252 bra outCH
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
253
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
254 * process attribute flag bit
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
255 L0291 rolb
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
256 bcs outCH
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
257 lda #'.
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
258 bra outCH
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
259
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
260 outZSP dec <zflag count down to last digit
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
261 outSP lda #C$SPAC append a SPACE to the line buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
262
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
263 * Append character in regA to the line buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
264 outCH pshs x
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
265 ldx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 sta ,x+
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
267 stx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 puls pc,x
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
269
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
270 * Copy an FCS string to the line buffer
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
271 L0296 bsr outCH
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
272 copySTR lda ,y+
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
273 bpl L0296
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 anda #$7F
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
275 bra outCH
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
276
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
277 * Append a CR and send entire line to stdout
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
278 writeBUF pshs y,x,a
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
279 lda #C$CR
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
280 bsr outCH
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
281 leax linebuf,u
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
282 stx <bufptr
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
283 ldy #80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 puls pc,y,x,a
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
287
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
288 * Print TIME as HH:MM:SS
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
289 L02B8 bsr L02C0 print HH
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
290 bsr L02BC print :MM
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
291 * print :SS and return
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
292 L02BC lda #':
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
293 bsr outCH
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 L02C0 ldb ,x+
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
295 L02C4 subb #100
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 bcc L02C4
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
297 * code to print 100's digit removed - max timefield value is 59
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
298 L02CF lda #'9+1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 L02D1 deca
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
300 addb #10
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 bcc L02D1
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
302 bsr outCH tens digit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 tfr b,a
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
304 adda #'0
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
305 bra outCH units digit
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
306
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
307 * copy module header & name to local buffers
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 L02DE pshs u,x
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
309 bsr L0308 D=ptr to mdir entry
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
310 ldx 4,x X=MD$MPtr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
311 ldy #13
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
312 leau >u10A2,u buffer for module header data
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
313 os9 F$CpyMem copy 13 bytes of module header
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
314 pshs b,a save DAT image ptr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
315 ldd 4,u name offset
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
316 leax d,x X=name ptr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
317 puls b,a restore DAT image ptr
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
318 ldu 2,s
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
319 leau >u1062,u U=ptr to name buffer
839
0303f3fa9df5 Changed e option to -e, optimized *slightly*
boisy
parents: 0
diff changeset
320 ldy #64
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
321 os9 F$CpyMem copy 64 bytes of name data
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
322 tfr u,y Y=ptr to name buf
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 puls pc,u,x
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
324
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
325 * calculate local buffer address for current mdir entry (DAT image ptr)
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
326 L0308 ldd ,x D=MD$MPDAT
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
327 beq L0319 if 0, skip empty slot
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 pshs y
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
329 leay <u0062,u Y=local MDIR buffer
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 pshs y
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
331 subd <u0060 D=offset (MD$MPDAT-mdstart)
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
332 addd ,s++ D=ptr to local mdir entry
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
333 puls y
1277
54ebe88fdc10 mdir fixes by Rodney!
boisy
parents: 1255
diff changeset
334 L0319 rts
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 end