annotate level1/cmds/verify.asm @ 3148:ffa4b0273cc7

3rdparty/utils/fpgarom: Utilities for CoCo3FPGA booting Includes Brett Gordon's CocoFPGA Boot ROM.
author Bill Pierce <merlinious999@gmail.com>
date Sat, 04 Feb 2017 18:54:49 +0100
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 * Verify - Verify a module's CRC
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 * 5 ????/??/??
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 * 6 2003/01/18 Boisy G. Pitre
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 924
diff changeset
13 * Option modified to require dash in front.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 nam Verify
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 ttl Verify a module's CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 * Disassembled 98/09/15 00:03:43 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
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
27 edition set 6
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: 908
diff changeset
31 org 0
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
32 crc1 rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
33 crc2 rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
34 crc3 rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
35 readcnt rmb 2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
36 dovfy rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
37 bufptr rmb 2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
38 bufsiz rmb 2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
39 bytesrd rmb 57
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 u0043 rmb 195
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
41 buffer rmb 1000
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 name fcs /Verify/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
47 start leas >buffer,u point S to buffer
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
48 sts <bufptr save pointer to buffer
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
49 tfr y,d transfer end of our mem to D
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
50 subd <bufptr subtract bufptr address
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
51 std <bufsiz
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
52 clr <dovfy
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
53 L0023 ldd ,x+ get two chars
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
54 cmpa #C$SPAC space?
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
55 beq L0023 branch if so
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
56 andb #$5F make uppercase
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
57 cmpd #$2D55 -U ?
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 bne L0031
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
59 inc <dovfy we will do verify
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
60 L0031 ldd #M$IDSize get module id size
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
61 std <readcnt save read count
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
62 lbsr DoRead
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 bcs L004D
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
64 cmpy #M$IDSize
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
65 bne BadMod
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
66 ldd ,x get first two bytes
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
67 cmpd #M$ID12 OS-9 module sync bytes?
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
68 bne BadMod branch if not
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
69 bsr DoCRCChk check header parity
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 bra L0031
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
71 L004D cmpb #E$EOF end of file error?
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
72 bne Exit branch if not
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
73 clrb else clear carry
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
74 Exit os9 F$Exit and exit
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
75
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
76 BadMod ldb #E$BMID
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
77 bra Exit
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
78
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
79 * Here is where we check the module
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
80 DoCRCChk clrb
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
81 * First we will check the header parity
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
82 lda #M$Parity
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 L005C eorb ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 bne L005C
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
86 lda <dovfy get verify flag
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
87 bne UpdtHdrP branch if we must do verify
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 eorb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 beq L0070
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
91 leax >HdrBad,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 bra L0074
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
93 L0070 leax >HdrGood,pcr
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
94 L0074 lbsr WriteLn
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 bra L007C
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
96 UpdtHdrP comb
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 stb ,x
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
98 L007C ldx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 ldy $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 leay -$03,y
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
101 sty <readcnt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 ldd #$FFFF
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
103 std <crc1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
104 stb <crc3
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 bsr L00D6
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
106 lda <dovfy
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
107 bne UpdtCRC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 ldd #$0003
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
109 std <readcnt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 bsr L00D6
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
111 lda <crc1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
112 cmpa #CRCCon1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 bne L00A8
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
114 ldd <crc2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
115 cmpd #CRCCon23
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 beq L00AE
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
117 L00A8 leax >CRCBad,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 bra L00B2
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
119 L00AE leax >CRCGood,pcr
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
120 L00B2 bsr WriteLn
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 bra L00CF
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
122 UpdtCRC com <crc1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
123 com <crc2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
124 com <crc3
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
125 lda #$01 to standard out
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
126 leax ,u point to CRCs
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
127 ldy #$0003 3 bytes
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
128 os9 I$Write write it out
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
129 bcs Exit branch if error
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 os9 I$Read
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
132 bcs Exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 L00CF rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
134 L00D0 bsr DoRead
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
135 lbcs Exit
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
136 L00D6 ldy <bytesrd
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 beq L00D0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 os9 F$CRC
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
139 lda <dovfy
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 beq L00EB
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
141 lda #$01 standard output
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
142 os9 I$Write write it
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
143 lbcs Exit branch if error
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
144 L00EB ldd <readcnt
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
145 subd <bytesrd
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
146 std <readcnt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 bne L00D0
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
148 std <bytesrd
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
150
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
151 DoRead clra
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
152 ldx <bufptr get buffer pointer
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
153 ldy <bufsiz get buffer size
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
154 cmpy <readcnt compare against read count
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
155 bls ExecRead if lower, use bufsiz
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
156 ldy <readcnt else read count
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
157 ExecRead os9 I$Read read data
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
158 sty <bytesrd save read count
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
160
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
161 WriteLn lda #$02
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
162 ldy #80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
165
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
166 HdrGood fcc "Header parity is correct."
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 fcb C$CR
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
168
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
169 HdrBad fcc "Header parity is INCORRECT !"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 fcb C$CR
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
171
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
172 CRCGood fcc "CRC is correct."
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 fcb C$CR
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
174
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
175 CRCBad fcc "CRC is INCORRECT !"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 fcb C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 end