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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
2 * Merge - Merge files into one 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 * ------------------------------------------------------------------
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
8 * 4 From 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 Merge
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
11 ttl Merge files into one file
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 ifp1
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
14 use defsfile
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 endc
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 0
diff changeset
16
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 rev set $01
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
20 edition set 4
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 0
diff changeset
21
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
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
c155aac72190 Made cosmetic changes
boisy
parents: 225
diff changeset
24 org 0
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
25 path rmb 1
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
26 param rmb 2
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
27 d.ptr rmb 2
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
28 d.size rmb 2
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
29 d.buffer rmb 2496 should reserve 7k, leaving some room for parameters
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
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
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
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
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
35 start pshs u save start address of memory
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
36 stx <param and parameter area start
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 tfr x,d
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
38 subd #$0107 take out 1 bytes in DP, and 1 page for the stack
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
39 subd ,s++ take out start address of data area
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
40 std <d.size save size of data buffer
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
41 leau d.buffer,u point to some data
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
42 stu <d.ptr save another pointer
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
43
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
44 do.file ldx <param get first filename
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
45 bsr space
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
46
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 clrb
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
48 cmpa #C$CR was the character a CR?
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
49 beq Exit yes, exit
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
50
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
51 lda #READ.
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
52 os9 I$Open open the file for reading
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
53 bcs Exit crap out if error
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
54 sta <path save path number
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
55 stx <param and save new address of parameter area
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
56
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
57 read.lp lda <path get the current path number
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
58 ldy <d.size and size of data to read
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
59 ldx <d.ptr and pointer to data buffer
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
60 os9 I$Read read data into the buffer
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
61 bcs chk.err check errors
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
62
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
63 lda #$01 to STDOUT
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
64 os9 I$Write dump it out in one shot
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
65 bcc read.lp loop if no errors
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
66 bra Exit otherwise exit ungracefully
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
67
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
68 chk.err cmpb #E$EOF end of the file?
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
69 bne Error no, error out
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
70 lda <path otherwise get the current path number
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
71 os9 I$Close close it
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
72 bcc do.file if no error, go get next filename
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
73
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
74 Error coma set carry
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
75 Exit os9 F$Exit and exit
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
76
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
77 space lda ,x+ grab a character
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
78 cmpa #C$SPAC space?
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
79 beq space yes, skip it
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
80 leax -1,x otherwise point to last non-space
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
81 rts
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
82
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 eom equ *
225
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
85 end
24637ab6e2b8 Moved a more commented version over
boisy
parents: 200
diff changeset
86