comparison level1/cmds/pwd.asm @ 270:baead4d344f1

Comment and label enhancements to source
author boisy
date Sun, 21 Jul 2002 06:04:12 +0000
parents e9ce43cc215e
children
comparison
equal deleted inserted replaced
269:8ac0ef66d530 270:baead4d344f1
12 12
13 * Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML 13 * Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML
14 14
15 ifp1 15 ifp1
16 use defsfile 16 use defsfile
17 use rbfdefs
17 endc 18 endc
18 19
19 tylg set Prgrm+Objct 20 tylg set Prgrm+Objct
20 atrv set ReEnt+rev 21 atrv set ReEnt+rev
21 rev set $01 22 rev set $01
23 24
24 mod eom,name,tylg,atrv,start,size 25 mod eom,name,tylg,atrv,start,size
25 26
26 fildes rmb 1 27 fildes rmb 1
27 bufptr rmb 2 28 bufptr rmb 2
28 u0003 rmb 2 29 DotDotFD rmb 3
29 u0005 rmb 1 30 DotFD rmb 3
30 u0006 rmb 2 31 DDCopy rmb 5
31 u0008 rmb 1 32 dentry rmb 160
32 u0009 rmb 2
33 u000B rmb 3
34 u000E rmb 29
35 u002B rmb 2
36 u002D rmb 129
37 buffer rmb 1 33 buffer rmb 1
38 sttbuf rmb 282 34 sttbuf rmb 282
39 size equ . 35 size equ .
40 36
41 name fcs /pwd/ 37 name fcs /pwd/
55 stx <bufptr 51 stx <bufptr
56 leax >dot,pcr 52 leax >dot,pcr
57 bsr open 53 bsr open
58 sta <fildes 54 sta <fildes
59 lbsr rdtwo 55 lbsr rdtwo
60 ldd <u0003 56 ldd <DotDotFD
61 std <u0009 57 std <DDCopy
62 lda <u0005 58 lda <DotDotFD+2
63 sta <u000B 59 sta <DDCopy+2
64 L0052 bsr L00C6 60 L0052 bsr L00C6
65 beq L0079 61 beq L0079
66 leax >dotdot,pcr 62 leax >dotdot,pcr
67 bsr chdir 63 bsr chdir
68 lda <fildes 64 lda <fildes
71 leax >dot,pcr 67 leax >dot,pcr
72 bsr open 68 bsr open
73 bsr rdtwo 69 bsr rdtwo
74 bsr L00A8 70 bsr L00A8
75 bsr L00E2 71 bsr L00E2
76 ldd <u0003 72 ldd <DotDotFD
77 std <u0009 73 std <DDCopy
78 lda <u0005 74 lda <DotDotFD+2
79 sta <u000B 75 sta <DDCopy+2
80 bra L0052 76 bra L0052
81 L0079 lbsr L00FB 77 L0079 lbsr L00FB
82 ldx <bufptr 78 ldx <bufptr
83 ldy #$0081 79 ldy #$0081
84 lda #$01 80 lda #$01
91 os9 I$ChgDir 87 os9 I$ChgDir
92 rts 88 rts
93 open lda #DIR.+READ. 89 open lda #DIR.+READ.
94 os9 I$Open 90 os9 I$Open
95 rts 91 rts
92
96 read32 lda <fildes 93 read32 lda <fildes
97 leax u000E,u 94 leax dentry,u
98 ldy #$0020 95 ldy #DIR.SZ
99 os9 I$Read 96 os9 I$Read
100 rts 97 rts
98
101 L00A8 lda <fildes 99 L00A8 lda <fildes
102 bsr read32 100 bsr read32
103 bcs L010F 101 bcs L010F
104 leax u000E,u 102 leax dentry,u
105 leax <$1D,x 103 leax <DIR.FD,x
106 leay u0009,u 104 leay DDCopy,u
107 bsr attop 105 bsr attop
108 bne L00A8 106 bne L00A8
109 rts 107 rts
108
110 attop ldd ,x++ 109 attop ldd ,x++
111 cmpd ,y++ 110 cmpd ,y++
112 bne L00C5 111 bne L00C5
113 lda ,x 112 lda ,x
114 cmpa ,y 113 cmpa ,y
115 L00C5 rts 114 L00C5 rts
116 L00C6 leax u0003,u 115
117 leay u0006,u 116 L00C6 leax DotDotFD,u
117 leay DotFD,u
118 bsr attop * check if we're at the top 118 bsr attop * check if we're at the top
119 rts 119 rts
120
120 rdtwo bsr read32 * read "." from directory 121 rdtwo bsr read32 * read "." from directory
121 ldd <u002B 122 ldd <dentry+DIR.FD
122 std <u0006 123 std <DotFD
123 lda <u002D 124 lda <dentry+DIR.FD+2
124 sta <u0008 125 sta <DotFD+2
125 bsr read32 * read ".." from directory 126 bsr read32 * read ".." from directory
126 ldd <u002B 127 ldd <dentry+DIR.FD
127 std <u0003 128 std <DotDotFD
128 lda <u002D 129 lda <dentry+DIR.FD+2
129 sta <u0005 130 sta <DotDotFD+2
130 rts 131 rts
131 L00E2 leax u000E,u 132
133 L00E2 leax dentry,u
132 prsnam os9 F$PrsNam 134 prsnam os9 F$PrsNam
133 bcs L0109 135 bcs L0109
134 ldx <bufptr 136 ldx <bufptr
135 L00EB lda ,-y 137 L00EB lda ,-y
136 anda #$7F 138 anda #$7F
137 sta ,-x 139 sta ,-x
138 decb 140 decb
139 bne L00EB 141 bne L00EB
140 lda #$2F 142 lda #PDELIM
141 sta ,-x 143 sta ,-x
142 stx <bufptr 144 stx <bufptr
143 rts 145 rts
144 L00FB lda <fildes 146 L00FB lda <fildes
145 ldb #SS.DevNm 147 ldb #SS.DevNm