0
|
1 ********************************************************************
|
|
2 * Binex - Motorola S-Record utility
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 67 Original Tandy distribution version
|
|
9
|
|
10 nam Binex
|
|
11 ttl Motorola S-Record utility
|
|
12
|
|
13 * Disassembled 98/09/15 00:08:52 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 ifp1
|
|
16 use defsfile
|
|
17 endc
|
|
18
|
|
19 tylg set Prgrm+Objct
|
|
20 atrv set ReEnt+rev
|
|
21 rev set $01
|
|
22 edition set 67
|
|
23
|
|
24 mod eom,name,tylg,atrv,start,size
|
|
25
|
|
26 u0000 rmb 1
|
|
27 u0001 rmb 1
|
|
28 u0002 rmb 2
|
|
29 u0004 rmb 1
|
|
30 u0005 rmb 1
|
|
31 u0006 rmb 1
|
|
32 u0007 rmb 2
|
|
33 u0009 rmb 1
|
|
34 u000A rmb 2
|
|
35 u000C rmb 1
|
|
36 u000D rmb 31
|
|
37 u002C rmb 1
|
|
38 u002D rmb 1
|
|
39 u002E rmb 1
|
|
40 u002F rmb 2
|
|
41 u0031 rmb 2
|
|
42 u0033 rmb 2
|
|
43 u0035 rmb 656
|
|
44 size equ .
|
|
45
|
|
46 name fcs /Binex/
|
|
47 fcc "Copyright 1982 Motorola, Inc."
|
|
48 fcb $01
|
|
49
|
|
50 start stx <u0002
|
|
51 lda #$01
|
|
52 os9 I$Open
|
|
53 bcc L003C
|
|
54 L0039 os9 F$Exit
|
|
55 L003C sta <u0000
|
|
56 stx <u0002
|
|
57 lda #$02
|
|
58 ldb #$7F
|
|
59 os9 I$Create
|
|
60 bcs L0039
|
|
61 sta <u0001
|
|
62 stx <u0002
|
|
63 ldd #$0000
|
|
64 sta <u0006
|
|
65 std <u000A
|
|
66 std <u002F
|
|
67 ldx #$5330
|
|
68 stx <u002D
|
|
69 ldx #$3030
|
|
70 stx <u0031
|
|
71 stx <u0033
|
|
72 L0062 leax >L0217,pcr
|
|
73 lda #$01
|
|
74 ldy #$0022
|
|
75 os9 I$Write
|
|
76 leax <u0031,u
|
|
77 lda #$00
|
|
78 ldy #$0005
|
|
79 os9 I$ReadLn
|
|
80 leay -$01,y
|
|
81 cmpy #$0000
|
|
82 beq L0062
|
|
83 cmpy #$0004
|
|
84 bhi L0062
|
|
85 beq L00A7
|
|
86 tfr y,d
|
|
87 pshs b
|
|
88 decb
|
|
89 leax <u0031,u
|
|
90 leay $04,x
|
|
91 L0095 lda b,x
|
|
92 sta ,-y
|
|
93 decb
|
|
94 bpl L0095
|
|
95 ldb #$04
|
|
96 subb ,s+
|
|
97 lda #$30
|
|
98 L00A2 sta ,-y
|
|
99 decb
|
|
100 bgt L00A2
|
|
101 L00A7 lbsr L0178
|
|
102 leax >L01F9,pcr
|
|
103 lda #$01
|
|
104 ldy #$001E
|
|
105 os9 I$Write
|
|
106 leax u000C,u
|
|
107 lda #$00
|
|
108 ldy #$0015
|
|
109 os9 I$ReadLn
|
|
110 leay -$01,y
|
|
111 cmpy #$0000
|
|
112 bne L0120
|
|
113 L00CA lda <u0000
|
|
114 leax u000C,u
|
|
115 ldy #$0020
|
|
116 os9 I$Read
|
|
117 lbcs L0160
|
|
118 cmpy #$0000
|
|
119 lbeq L0160
|
|
120 lda <u0006
|
|
121 bne L0120
|
|
122 inc <u0006
|
|
123 lda #$31
|
|
124 sta <u002E
|
|
125 ldx <u0004
|
|
126 stx <u000A
|
|
127 ldx u000C,u
|
|
128 cmpx #$87CD
|
|
129 beq L0120
|
|
130 leax >L0239,pcr
|
|
131 pshs y
|
|
132 ldy #$003C
|
|
133 lda #$01
|
|
134 os9 I$Write
|
|
135 leax <u0035,u
|
|
136 ldy #$0002
|
|
137 lda #$00
|
|
138 os9 I$ReadLn
|
|
139 puls y
|
|
140 lda <u0035,u
|
|
141 anda #$DF
|
|
142 cmpa #$59
|
|
143 beq L0120
|
|
144 L011C clrb
|
|
145 os9 F$Exit
|
|
146 L0120 sty <u0007
|
|
147 tfr y,d
|
|
148 addb #$03
|
|
149 stb <u0009
|
|
150 leax u0009,u
|
|
151 clra
|
|
152 ldb ,x
|
|
153 L012E adda ,x+
|
|
154 decb
|
|
155 bne L012E
|
|
156 coma
|
|
157 sta ,x
|
|
158 leax u0009,u
|
|
159 leay <u002F,u
|
|
160 ldb ,x
|
|
161 incb
|
|
162 L013E bsr L01B6
|
|
163 decb
|
|
164 bne L013E
|
|
165 ldb #$0D
|
|
166 stb ,y
|
|
167 leax <u002D,u
|
|
168 ldy #$0073
|
|
169 lda <u0001
|
|
170 os9 I$WritLn
|
|
171 lbcs L0039
|
|
172 ldd <u000A
|
|
173 addd <u0007
|
|
174 std <u000A
|
|
175 lbra L00CA
|
|
176 L0160 cmpb #$D3
|
|
177 lbne L0039
|
|
178 lda #$39
|
|
179 cmpa <u002E
|
|
180 beq L011C
|
|
181 sta <u002E
|
|
182 ldx <u0004
|
|
183 stx <u000A
|
|
184 ldy #$0000
|
|
185 bra L0120
|
|
186 L0178 bsr L017C
|
|
187 sta <u0004
|
|
188 L017C lda ,x+
|
|
189 bsr L0197
|
|
190 lsla
|
|
191 lsla
|
|
192 lsla
|
|
193 lsla
|
|
194 anda #$F0
|
|
195 pshs a
|
|
196 lda ,x+
|
|
197 bsr L0197
|
|
198 adda ,s+
|
|
199 sta <u0005
|
|
200 adda <u002C
|
|
201 sta <u002C
|
|
202 lda <u0005
|
|
203 rts
|
|
204 L0197 suba #$30
|
|
205 bmi L01A6
|
|
206 cmpa #$09
|
|
207 ble L01A5
|
|
208 suba #$07
|
|
209 cmpa #$0F
|
|
210 bhi L01A6
|
|
211 L01A5 rts
|
|
212 L01A6 leax >L01D7,pcr
|
|
213 lda #$02
|
|
214 ldy #$00FF
|
|
215 os9 I$WritLn
|
|
216 lbra L011C
|
|
217 L01B6 pshs b,a
|
|
218 lda ,x+
|
|
219 tfr a,b
|
|
220 lsra
|
|
221 lsra
|
|
222 lsra
|
|
223 lsra
|
|
224 bsr L01CC
|
|
225 sta ,y+
|
|
226 tfr b,a
|
|
227 bsr L01CC
|
|
228 sta ,y+
|
|
229 puls pc,b,a
|
|
230 L01CC anda #$0F
|
|
231 adda #$30
|
|
232 cmpa #$39
|
|
233 bls L01D6
|
|
234 adda #$07
|
|
235 L01D6 rts
|
|
236 L01D7 fcc "** NON-HEX CHARACTER ENCOUNTERED"
|
|
237 fcb $07,C$CR
|
|
238 L01F9 fcc "Enter name for header record: "
|
|
239 L0217 fcc "Enter starting address for file: $"
|
|
240 L0239 fcb $07,C$CR,C$LF
|
|
241 fcc "** Not a binary load module file. Proceed anyway (Y/N)? "
|
|
242
|
|
243 emod
|
|
244 eom equ *
|
|
245 end
|