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