annotate level1/cmds/makdir.asm @ 924:c155aac72190

Made cosmetic changes
author boisy
date Sun, 19 Jan 2003 14:54:09 +0000
parents 1810b051d07e
children 84ea83668304
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
2 * MakDir - Create directory file
0
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: 0
diff changeset
8 * 4 From Tandy OS-9 Level One VR 02.00.00
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
9 * 5 Makes multiple directories from a single ADK
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 nam Makdir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 ttl Create directory file
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
14 * Disassembled 94/12/08 21:42:56 by Alan DeKok
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 use defsfile
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
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
23 edition set 5
0
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
924
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
27 org 0
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
28 param rmb 2 parameter area
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
29 mflag rmb 1 made a directory yet from this pathlist?
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
30 rmb 200 stack space
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
33 name fcs /MakDir/
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 0
diff changeset
34 fcb edition
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
36 Sk.1 leax 1,x go on to the next character
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
37 Skip lda ,x get a character
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
38 cmpa #C$SPAC space?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
39 beq Sk.1 if so, skip it
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
40 rts
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
41
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
42 * Any pathnames at all?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
43 * Exit with error if none
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
44 Start bsr Skip skip the first bit, if applicable
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
45 cmpa #C$SPAC is it a CR?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
46 bne start2 no, go ahead and make directories
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
47 comb set carry
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
48 ldb #E$BPNam a CR is a bad pathname...
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
49 bra Exit and go exit
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
50
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
51 * skip leading spaces or '/' and setup pointers
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
52 start1 bsr Skip skip any non-zero characters, if applicable
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
53 start2 ldb #$FF a non-zero value
924
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
54 stb <mflag we haven't made a directory from this pathname yet
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
55 stx <param save in the parameter area
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
56 cmpa #PDELIM leading slash?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
57 bne S.020 if not, go get the name
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
58
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
59 * find the pseudo-end of the pathname, stopping at space, cr, '/'
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
60 S.010 leax 1,x
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
61 S.020 lda ,x
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
62 cmpa #C$SPAC space?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
63 beq S.030
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
64 cmpa #C$CR cr?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
65 beq S.030
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
66 cmpa #PDELIM slash?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
67 bne S.010 if none of these, then skip this character
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
68
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
69 * force the pathname to be a subset of the full pathname
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
70 S.030 pshs a,x save byte found, where we found it
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
71 lda #C$CR force it to be a CR
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
72 sta ,x
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
73
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
74 *try to open it for reading, i.e. does it already exists?
924
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
75 ldx <param get the start address of this pathname
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
76 lda #DIR.+READ. open the directory for reading
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
77 os9 I$Open check if the directory already exists
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
78 bcs S.040 if there was an error opening it, go make it
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
79 OS9 I$Close close the path to the file
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
80 bra S.050 skip making this directory
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
81
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
82 * The partial pathname doesn't exist, so create it
924
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
83 S.040 ldx <param get the start address of this pathname
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
84 ldb #^SHARE. everything but SHARE.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 os9 I$MakDir
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
86 bcs Error
924
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
87 clr <mflag clear the flag: we've successfully made a directory
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
88
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
89 * make pathname full again, and continue
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
90 S.050 puls a,x restore byte, address
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
91 sta ,x restore it
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
92 cmpa #PDELIM was it a slash?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
93 beq S.010 yes, make pathname full again, and find next one
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
94
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
95 * searched this pathname, have we made a directory from it?
924
c155aac72190 Made cosmetic changes
boisy
parents: 662
diff changeset
96 tst <mflag have we made a directory?
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
97 bne CEF if not, error out with fake E$CEF
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
98
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
99 * check for end/continue flag
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
100 cmpa #C$SPAC was it a space?
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
101 beq start1 yup, go get another pathname to create
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
102
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
103 ClnExit clrb no error
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
104 Exit OS9 F$Exit and exit
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
105
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
106 CEF comb set carry
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
107 ldb #E$CEF we've just tried to create an existing file
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
108 Error pshs b,cc save error code
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
109
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
110 lda #2 to STDERR
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
111 leax EMsg,pc to error found string
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
112 ldy #Elen
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
113 OS9 I$Write
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
114
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
115 ldx <param get pathname we're trying to open
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
116 ldy #200 a _very_ long pathname
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
117 OS9 I$WritLn we're sure that the name ends in a CR...
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
118 puls b,cc restore error code, condition
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
119 bra Exit
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
120
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
121 EMsg fcc /makdir: error creating /
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
122 ELen equ *-EMsg
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 end