annotate level1/cmds/exbin.asm @ 3295:6b7a7b233925 default tip

makefile: Allow PORTS with level1/2 mix https://sourceforge.net/p/nitros9/feature-requests/10/
author Tormod Volden <debian.tormod@gmail.com>
date Tue, 19 Apr 2022 18:12:17 +0200
parents 84ea83668304
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * Exbin - Motorola S-Record utility
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 * 67 ????/??/??
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 * 1 2003/01/14 Boisy G. Pitre
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 924
diff changeset
13 * Restarted edition, removed Motorola copyright.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 nam Exbin
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 ttl Motorola S-Record utility
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 * Disassembled 98/09/15 00:16:49 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
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
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
27 edition set 1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30
924
c155aac72190 Made cosmetic changes
boisy
parents: 846
diff changeset
31 org 0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 u0000 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 u0001 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 u0002 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 u0004 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 u0005 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 u0006 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 u0008 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 u0009 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 u000B rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 u000C rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 u000D rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 u000E rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 u000F rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 u0010 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 u0012 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 u0014 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 u0016 rmb 656
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 name fcs /Exbin/
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 0
diff changeset
52 fcb edition
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 0
diff changeset
53
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
54 * fcc "Copyright 1982 Motorola, Inc."
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
55 * fcb $01
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 start stx <u0002
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
58 lda #READ.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 os9 I$Open
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 bcc L003C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 L0039 os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 L003C sta <u0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 stx <u0002
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
64 lda #WRITE.
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
65 ldb #SHARE.+PEXEC.+PWRIT.+PREAD.+EXEC.+UPDAT.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 os9 I$Create
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 bcs L0039
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 sta <u0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 stx <u0002
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 ldd #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 std <u0009
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 std <u000B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 sta <u000F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 ldx #$4E61
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 stx <u0010
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 ldx #$6D65
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 stx <u0012
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 ldx #$3D20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 stx <u0014
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 L0065 lda <u0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 leax <u0016,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 ldy #$0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 os9 I$ReadLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 lbcs L0114
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 leax <u0016,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 tfr x,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 tfr x,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 addd #$0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 std <u0006
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 L0081 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 cmpa #$53
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 beq L008D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 cmpx <u0006
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 bne L0081
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 bra L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 L008D lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 suba #$30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 sta <u000E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 beq L009E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 cmpa #$09
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 bne L009B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 bra L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 L009B deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 bne L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 L009E bsr L011F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 sta <u0008
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 suba #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 sta <u000C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 sta <u000D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 bsr L011B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 tst <u000E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 beq L00CD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 ldx <u0009
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 lda <u000F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 beq L00C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 cmpx <u0004
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 beq L00C6
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
119 leax >NonCtg,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 bra L00DE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 L00C0 ldx <u0004
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 sta <u000F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 L00C6 ldb <u000C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 abx
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 stx <u0009
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 L00CD bsr L011F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 dec <u000D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 bpl L00CD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 lda <u0008
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 beq L00EB
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
135 leax >CSumErr,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 L00DE lda #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 ldy #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 L00E7 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 lbra L0039
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 L00EB lda <u000E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 bne L0102
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 lda #$0D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 sta ,-y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 ldy #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 leax <u0010,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 lbra L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 L0102 lda <u0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 ldy <u000B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 leax <u0016,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 os9 I$Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 lbcc L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 lbra L0039
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 L0114 cmpb #$D3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 beq L00E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 lbra L0039
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 L011B bsr L011F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 sta <u0004
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 L011F lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 bsr L013A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 anda #$F0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 bsr L013A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 adda ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 sta <u0005
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 adda <u0008
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 sta <u0008
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 lda <u0005
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 L013A suba #$30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 bmi L0149
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 cmpa #$09
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 ble L0148
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 suba #$07
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 cmpa #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 bhi L0149
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 L0148 rts
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
185 L0149 leax >NonHex,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 bra L00DE
846
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
187 NonHex fcc "** Non-hex character encountered"
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
188 fcb C$BELL,C$CR
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
189 CSumErr fcc "** Checksum error detected"
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
190 fcb C$BELL,C$CR
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
191 NonCtg fcc "** Non-contiguous address space detected"
c6e6cf68e03e Optimized
boisy
parents: 200
diff changeset
192 fcb C$BELL,C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 end