annotate level2/cmds/mdir.asm @ 3226:9749d0dfc4a2

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