Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/merge.asm @ 1325:84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
author | boisy |
---|---|
date | Thu, 04 Sep 2003 23:06:16 +0000 |
parents | c155aac72190 |
children | 76b1793dbd1c |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
225 | 2 * Merge - Merge files into one 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. |
0 | 11 |
12 nam Merge | |
225 | 13 ttl Merge files into one file |
0 | 14 |
15 ifp1 | |
225 | 16 use defsfile |
0 | 17 endc |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
18 |
0 | 19 tylg set Prgrm+Objct |
20 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
21 rev set $00 |
225 | 22 edition set 4 |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
23 |
0 | 24 mod eom,name,tylg,atrv,start,size |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
25 |
924 | 26 org 0 |
225 | 27 path rmb 1 |
28 param rmb 2 | |
29 d.ptr rmb 2 | |
30 d.size rmb 2 | |
31 d.buffer rmb 2496 should reserve 7k, leaving some room for parameters | |
0 | 32 size equ . |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
33 |
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
34 name fcs /Merge/ |
225 | 35 fcb edition change to 6, as merge 5 has problems? |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
36 |
225 | 37 start pshs u save start address of memory |
38 stx <param and parameter area start | |
0 | 39 tfr x,d |
225 | 40 subd #$0107 take out 1 bytes in DP, and 1 page for the stack |
41 subd ,s++ take out start address of data area | |
42 std <d.size save size of data buffer | |
43 leau d.buffer,u point to some data | |
44 stu <d.ptr save another pointer | |
45 | |
46 do.file ldx <param get first filename | |
47 bsr space | |
48 | |
0 | 49 clrb |
225 | 50 cmpa #C$CR was the character a CR? |
51 beq Exit yes, exit | |
52 | |
53 lda #READ. | |
54 os9 I$Open open the file for reading | |
55 bcs Exit crap out if error | |
56 sta <path save path number | |
57 stx <param and save new address of parameter area | |
58 | |
59 read.lp lda <path get the current path number | |
60 ldy <d.size and size of data to read | |
61 ldx <d.ptr and pointer to data buffer | |
62 os9 I$Read read data into the buffer | |
63 bcs chk.err check errors | |
64 | |
65 lda #$01 to STDOUT | |
66 os9 I$Write dump it out in one shot | |
67 bcc read.lp loop if no errors | |
68 bra Exit otherwise exit ungracefully | |
69 | |
70 chk.err cmpb #E$EOF end of the file? | |
71 bne Error no, error out | |
72 lda <path otherwise get the current path number | |
73 os9 I$Close close it | |
74 bcc do.file if no error, go get next filename | |
75 | |
76 Error coma set carry | |
77 Exit os9 F$Exit and exit | |
78 | |
79 space lda ,x+ grab a character | |
80 cmpa #C$SPAC space? | |
81 beq space yes, skip it | |
82 leax -1,x otherwise point to last non-space | |
83 rts | |
84 | |
0 | 85 emod |
86 eom equ * | |
225 | 87 end |
88 |