Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/makdir.asm @ 2898:28ed72477814 lwtools-port
Dummy merge of default branch into lwtools
hg -y merge --tool=internal:fail default
hg revert --all --no-backup --rev .
hg resolve -a -m
This dummy merge discards any changes from the default branch
so that the result is the same as what lwtools already had.
When merging back to default branch later, the discarded
changes will be discarded there also, so the result
will be that the default branch will contain what
the lwtools branch had before these merges.
Only scripts/burst was "rescued" from default branch.
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sat, 11 Jan 2014 18:40:44 +0100 |
parents | 84ea83668304 |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
2 * MakDir - Create directory file |
0 | 3 * |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
6 * Edt/Rev YYYY/MM/DD Modified by |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
7 * Comment |
0 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
9 * 4 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
10 * From Tandy OS-9 Level One VR 02.00.00. |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
11 * |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
12 * 5 ????/??/?? Alan DeKok |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
13 * Makes multiple directories from a single pathlist. |
0 | 14 |
15 nam Makdir | |
16 ttl Create directory file | |
17 | |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
18 * Disassembled 94/12/08 21:42:56 by Alan DeKok |
0 | 19 |
20 ifp1 | |
21 use defsfile | |
22 endc | |
23 | |
24 tylg set Prgrm+Objct | |
25 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
26 rev set $00 |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
27 edition set 5 |
0 | 28 |
29 mod eom,name,tylg,atrv,start,size | |
30 | |
924 | 31 org 0 |
32 param rmb 2 parameter area | |
33 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
|
34 rmb 200 stack space |
0 | 35 size equ . |
36 | |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
37 name fcs /MakDir/ |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
38 fcb edition |
0 | 39 |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
40 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
|
41 Skip lda ,x get a character |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
42 cmpa #C$SPAC space? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
43 beq Sk.1 if so, skip it |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
44 rts |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
45 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
46 * Any pathnames at all? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
47 * Exit with error if none |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
48 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
|
49 cmpa #C$SPAC is it a CR? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
50 bne start2 no, go ahead and make directories |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
51 comb set carry |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
52 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
|
53 bra Exit and go exit |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
54 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
55 * skip leading spaces or '/' and setup pointers |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
56 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
|
57 start2 ldb #$FF a non-zero value |
924 | 58 stb <mflag we haven't made a directory from this pathname yet |
59 stx <param save in the parameter area | |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
60 cmpa #PDELIM leading slash? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
61 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
|
62 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
63 * 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
|
64 S.010 leax 1,x |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
65 S.020 lda ,x |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
66 cmpa #C$SPAC space? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
67 beq S.030 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
68 cmpa #C$CR cr? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
69 beq S.030 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
70 cmpa #PDELIM slash? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
71 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
|
72 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
73 * 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
|
74 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
|
75 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
|
76 sta ,x |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
77 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
78 *try to open it for reading, i.e. does it already exists? |
924 | 79 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
|
80 lda #DIR.+READ. open the directory for reading |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
81 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
|
82 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
|
83 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
|
84 bra S.050 skip making this directory |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
85 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
86 * The partial pathname doesn't exist, so create it |
924 | 87 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
|
88 ldb #^SHARE. everything but SHARE. |
0 | 89 os9 I$MakDir |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
90 bcs Error |
924 | 91 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
|
92 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
93 * make pathname full again, and continue |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
94 S.050 puls a,x restore byte, address |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
95 sta ,x restore it |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
96 cmpa #PDELIM was it a slash? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
97 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
|
98 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
99 * searched this pathname, have we made a directory from it? |
924 | 100 tst <mflag have we made a directory? |
662
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
101 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
|
102 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
103 * check for end/continue flag |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
104 cmpa #C$SPAC was it a space? |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
105 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
|
106 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
107 ClnExit clrb no error |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
108 Exit OS9 F$Exit and exit |
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 CEF comb set carry |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
111 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
|
112 Error pshs b,cc save error code |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
113 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
114 lda #2 to STDERR |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
115 leax EMsg,pc to error found string |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
116 ldy #Elen |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
117 OS9 I$Write |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
118 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
119 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
|
120 ldy #200 a _very_ long pathname |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
121 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
|
122 puls b,cc restore error code, condition |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
123 bra Exit |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
124 |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
125 EMsg fcc /makdir: error creating / |
1810b051d07e
copy, display and makdir are now improved versions with enhanced
boisy
parents:
200
diff
changeset
|
126 ELen equ *-EMsg |
0 | 127 |
128 emod | |
129 eom equ * | |
130 end |