0
|
1 ********************************************************************
|
|
2 * pxd - Print execution directory
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
15
|
8 * 1 Original Tandy/Microware version BGP 02/04/05
|
0
|
9
|
|
10 nam pxd
|
|
11 ttl Print working directory
|
|
12
|
|
13 * Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 ifp1
|
|
16 use defsfile
|
|
17 endc
|
|
18
|
|
19 tylg set Prgrm+Objct
|
|
20 atrv set ReEnt+rev
|
|
21 rev set $01
|
|
22 edition set 1
|
|
23
|
|
24 mod eom,name,tylg,atrv,start,size
|
|
25
|
|
26 fildes rmb 1
|
13
|
27 bufptr rmb 2
|
0
|
28 u0003 rmb 2
|
|
29 u0005 rmb 1
|
|
30 u0006 rmb 2
|
|
31 u0008 rmb 1
|
|
32 u0009 rmb 2
|
|
33 u000B rmb 3
|
|
34 u000E rmb 29
|
|
35 u002B rmb 2
|
|
36 u002D rmb 129
|
13
|
37 buffer rmb 1
|
0
|
38 sttbuf rmb 282
|
|
39 size equ .
|
|
40
|
|
41 name fcs /pxd/
|
|
42 fcb edition
|
|
43
|
|
44 badnam fcc "pxd: bad name in path"
|
|
45 fcb C$CR
|
|
46 dotdot fcc "."
|
|
47 dot fcc "."
|
|
48 cr fcb C$CR
|
|
49 rdmsg fcc "read error"
|
|
50 fcb C$CR
|
|
51
|
13
|
52 start leax >buffer,u
|
|
53 lda #C$CR
|
0
|
54 sta ,x
|
13
|
55 stx <bufptr
|
0
|
56 leax >dot,pcr
|
|
57 bsr open
|
|
58 sta <fildes
|
|
59 lbsr rdtwo
|
|
60 ldd <u0003
|
|
61 std <u0009
|
|
62 lda <u0005
|
|
63 sta <u000B
|
|
64 L0052 bsr L00C6
|
|
65 beq L0079
|
|
66 leax >dotdot,pcr
|
|
67 bsr chdir
|
|
68 lda <fildes
|
|
69 os9 I$Close
|
|
70 bcs L008D
|
|
71 leax >dot,pcr
|
|
72 bsr open
|
|
73 bsr rdtwo
|
|
74 bsr L00A8
|
|
75 bsr L00E2
|
|
76 ldd <u0003
|
|
77 std <u0009
|
|
78 lda <u0005
|
|
79 sta <u000B
|
|
80 bra L0052
|
|
81 L0079 lbsr L00FB
|
13
|
82 ldx <bufptr
|
0
|
83 ldy #$0081
|
|
84 lda #$01
|
|
85 os9 I$WritLn
|
|
86 lda <fildes
|
|
87 os9 I$Close
|
|
88 clrb
|
|
89 L008D os9 F$Exit
|
13
|
90 chdir lda #DIR.+EXEC.+READ.
|
0
|
91 os9 I$ChgDir
|
|
92 rts
|
13
|
93 open lda #DIR.+EXEC.+READ.
|
0
|
94 os9 I$Open
|
|
95 rts
|
|
96 read32 lda <fildes
|
|
97 leax u000E,u
|
|
98 ldy #$0020
|
|
99 os9 I$Read
|
|
100 rts
|
|
101 L00A8 lda <fildes
|
|
102 bsr read32
|
|
103 bcs L010F
|
|
104 leax u000E,u
|
|
105 leax <$1D,x
|
|
106 leay u0009,u
|
|
107 bsr attop
|
|
108 bne L00A8
|
|
109 rts
|
|
110 attop ldd ,x++
|
|
111 cmpd ,y++
|
|
112 bne L00C5
|
|
113 lda ,x
|
|
114 cmpa ,y
|
|
115 L00C5 rts
|
|
116 L00C6 leax u0003,u
|
|
117 leay u0006,u
|
|
118 bsr attop * check if we're at the top
|
|
119 rts
|
|
120 rdtwo bsr read32 * read "." from directory
|
|
121 ldd <u002B
|
|
122 std <u0006
|
|
123 lda <u002D
|
|
124 sta <u0008
|
|
125 bsr read32 * read ".." from directory
|
|
126 ldd <u002B
|
|
127 std <u0003
|
|
128 lda <u002D
|
|
129 sta <u0005
|
|
130 rts
|
|
131 L00E2 leax u000E,u
|
|
132 prsnam os9 F$PrsNam
|
|
133 bcs L0109
|
13
|
134 ldx <bufptr
|
0
|
135 L00EB lda ,-y
|
|
136 anda #$7F
|
|
137 sta ,-x
|
|
138 decb
|
|
139 bne L00EB
|
|
140 lda #$2F
|
|
141 sta ,-x
|
13
|
142 stx <bufptr
|
0
|
143 rts
|
|
144 L00FB lda <fildes
|
13
|
145 ldb #SS.DevNm
|
0
|
146 leax >sttbuf,u
|
|
147 os9 I$GetStt
|
|
148 bsr prsnam
|
|
149 rts
|
|
150 L0109 leax >badnam,pcr
|
|
151 bra wrerr
|
|
152 L010F leax >rdmsg,pcr
|
|
153 bra wrerr
|
|
154 L0115 lda #$02
|
|
155 os9 I$Write
|
|
156 bcs L0128
|
|
157 rts
|
|
158 bsr L0115
|
|
159 leax >cr,pcr
|
|
160 wrerr lda #$02
|
|
161 os9 I$WritLn
|
|
162 L0128 ldb #$00
|
|
163 os9 F$Exit
|
|
164
|
|
165 emod
|
|
166 eom equ *
|
|
167 end
|
|
168
|