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