annotate level1/cmds/pwd.asm @ 537:765ff88d3db7

6309 assembler from Curtis Boyle
author boisy
date Sun, 13 Oct 2002 21:37:16 +0000
parents baead4d344f1
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 * pwd - Print working directory
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 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 15
diff changeset
8 * 1 From Tandy OS-9 Level One VR 02.00.00
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 nam pwd
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 ttl Print working directory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
13 * Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 use defsfile
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
17 use rbfdefs
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 rev set $01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 edition set 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
27 fildes rmb 1
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
28 bufptr rmb 2
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
29 DotDotFD rmb 3
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
30 DotFD rmb 3
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
31 DDCopy rmb 5
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
32 dentry rmb 160
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
33 buffer rmb 1
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
34 sttbuf rmb 282
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 name fcs /pwd/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 fcb edition
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
39
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
40 badnam fcc "pwd: bad name in path"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 fcb C$CR
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
42 dotdot fcc "."
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
43 dot fcc "."
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
44 cr fcb C$CR
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
45 rdmsg fcc "read error"
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
46 fcb C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
48 start leax >buffer,u
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
49 lda #C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 sta ,x
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
51 stx <bufptr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
52 leax >dot,pcr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
53 bsr open
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
54 sta <fildes
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
55 lbsr rdtwo
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
56 ldd <DotDotFD
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
57 std <DDCopy
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
58 lda <DotDotFD+2
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
59 sta <DDCopy+2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 L0052 bsr L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 beq L0079
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
62 leax >dotdot,pcr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
63 bsr chdir
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
64 lda <fildes
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 os9 I$Close
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 bcs L008D
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
67 leax >dot,pcr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
68 bsr open
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
69 bsr rdtwo
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 bsr L00A8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 bsr L00E2
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
72 ldd <DotDotFD
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
73 std <DDCopy
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
74 lda <DotDotFD+2
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
75 sta <DDCopy+2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 bra L0052
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 L0079 lbsr L00FB
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
78 ldx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 ldy #$0081
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 os9 I$WritLn
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
82 lda <fildes
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 os9 I$Close
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 L008D os9 F$Exit
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
86 chdir lda #DIR.+READ.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 os9 I$ChgDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 rts
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
89 open lda #DIR.+READ.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 os9 I$Open
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 rts
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
92
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
93 read32 lda <fildes
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
94 leax dentry,u
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
95 ldy #DIR.SZ
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 os9 I$Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 rts
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
98
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
99 L00A8 lda <fildes
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
100 bsr read32
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 bcs L010F
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
102 leax dentry,u
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
103 leax <DIR.FD,x
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
104 leay DDCopy,u
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
105 bsr attop
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 bne L00A8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 rts
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
108
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
109 attop ldd ,x++
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 cmpd ,y++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 bne L00C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 cmpa ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 L00C5 rts
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
115
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
116 L00C6 leax DotDotFD,u
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
117 leay DotFD,u
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
118 bsr attop * check if we're at the top
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 rts
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
120
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
121 rdtwo bsr read32 * read "." from directory
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
122 ldd <dentry+DIR.FD
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
123 std <DotFD
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
124 lda <dentry+DIR.FD+2
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
125 sta <DotFD+2
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
126 bsr read32 * read ".." from directory
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
127 ldd <dentry+DIR.FD
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
128 std <DotDotFD
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
129 lda <dentry+DIR.FD+2
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
130 sta <DotDotFD+2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 rts
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
132
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
133 L00E2 leax dentry,u
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
134 prsnam os9 F$PrsNam
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 bcs L0109
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
136 ldx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 L00EB lda ,-y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 anda #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 sta ,-x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 bne L00EB
270
baead4d344f1 Comment and label enhancements to source
boisy
parents: 200
diff changeset
142 lda #PDELIM
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 sta ,-x
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
144 stx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 rts
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
146 L00FB lda <fildes
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
147 ldb #SS.DevNm
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
148 leax >sttbuf,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 os9 I$GetStt
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
150 bsr prsnam
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 rts
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
152 L0109 leax >badnam,pcr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
153 bra wrerr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
154 L010F leax >rdmsg,pcr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
155 bra wrerr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 L0115 lda #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 os9 I$Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 bcs L0128
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 bsr L0115
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
161 leax >cr,pcr
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
162 wrerr lda #$02
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 L0128 ldb #$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 end
13
5a5574d54988 Touched up source comments, added mdir to Makefile
boisy
parents: 0
diff changeset
170