annotate level1/cmds/verify.asm @ 1020:c1a5613ffe7b

changes
author boisy
date Thu, 06 Mar 2003 01:41:03 +0000
parents c155aac72190
children 84ea83668304
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 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 161
diff changeset
8 * 5 From Tandy OS-9 Level One VR 02.00.00
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
9 * 6 Option modified to require dash in frot BGP 03/01/18
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 nam Verify
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 ttl Verify a module's CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 * Disassembled 98/09/15 00:03:43 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 rev set $01
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
23 edition set 6
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
924
c155aac72190 Made cosmetic changes
boisy
parents: 908
diff changeset
27 org 0
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
28 crc1 rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
29 crc2 rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
30 crc3 rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
31 readcnt rmb 2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
32 dovfy rmb 1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
33 bufptr rmb 2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
34 bufsiz rmb 2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
35 bytesrd rmb 57
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 u0043 rmb 195
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
37 buffer rmb 1000
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 name fcs /Verify/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
43 start leas >buffer,u point S to buffer
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
44 sts <bufptr save pointer to buffer
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
45 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
46 subd <bufptr subtract bufptr address
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
47 std <bufsiz
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
48 clr <dovfy
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
49 L0023 ldd ,x+ get two chars
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
50 cmpa #C$SPAC space?
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
51 beq L0023 branch if so
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
52 andb #$5F make uppercase
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
53 cmpd #$2D55 -U ?
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 bne L0031
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
55 inc <dovfy we will do verify
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
56 L0031 ldd #M$IDSize get module id size
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
57 std <readcnt save read count
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
58 lbsr DoRead
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 bcs L004D
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
60 cmpy #M$IDSize
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
61 bne BadMod
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
62 ldd ,x get first two bytes
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
63 cmpd #M$ID12 OS-9 module sync bytes?
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
64 bne BadMod branch if not
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
65 bsr DoCRCChk check header parity
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 bra L0031
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
67 L004D cmpb #E$EOF end of file error?
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
68 bne Exit branch if not
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
69 clrb else clear carry
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
70 Exit os9 F$Exit and exit
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
71
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
72 BadMod ldb #E$BMID
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
73 bra Exit
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
74
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
75 * Here is where we check the module
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
76 DoCRCChk clrb
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
77 * First we will check the header parity
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
78 lda #M$Parity
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 L005C eorb ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 bne L005C
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
82 lda <dovfy get verify flag
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
83 bne UpdtHdrP branch if we must do verify
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 eorb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 beq L0070
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
87 leax >HdrBad,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 bra L0074
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
89 L0070 leax >HdrGood,pcr
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
90 L0074 lbsr WriteLn
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 bra L007C
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
92 UpdtHdrP comb
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 stb ,x
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
94 L007C ldx <bufptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 ldy $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 leay -$03,y
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
97 sty <readcnt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 ldd #$FFFF
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
99 std <crc1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
100 stb <crc3
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 bsr L00D6
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
102 lda <dovfy
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
103 bne UpdtCRC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 ldd #$0003
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
105 std <readcnt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 bsr L00D6
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
107 lda <crc1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
108 cmpa #CRCCon1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 bne L00A8
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
110 ldd <crc2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
111 cmpd #CRCCon23
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 beq L00AE
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
113 L00A8 leax >CRCBad,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 bra L00B2
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
115 L00AE leax >CRCGood,pcr
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
116 L00B2 bsr WriteLn
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 bra L00CF
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
118 UpdtCRC com <crc1
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
119 com <crc2
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
120 com <crc3
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
121 lda #$01 to standard out
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
122 leax ,u point to CRCs
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
123 ldy #$0003 3 bytes
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
124 os9 I$Write write it out
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
125 bcs Exit branch if error
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 os9 I$Read
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
128 bcs Exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 L00CF rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
130 L00D0 bsr DoRead
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
131 lbcs Exit
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
132 L00D6 ldy <bytesrd
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 beq L00D0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 os9 F$CRC
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
135 lda <dovfy
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 beq L00EB
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
137 lda #$01 standard output
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
138 os9 I$Write write it
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
139 lbcs Exit branch if error
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
140 L00EB ldd <readcnt
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
141 subd <bytesrd
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
142 std <readcnt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 bne L00D0
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
144 std <bytesrd
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
146
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
147 DoRead clra
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
148 ldx <bufptr get buffer pointer
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
149 ldy <bufsiz get buffer size
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
150 cmpy <readcnt compare against read count
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
151 bls ExecRead if lower, use bufsiz
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
152 ldy <readcnt else read count
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
153 ExecRead os9 I$Read read data
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
154 sty <bytesrd save read count
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
156
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
157 WriteLn lda #$02
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
158 ldy #80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 rts
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
161
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
162 HdrGood fcc "Header parity is correct."
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 fcb C$CR
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
164
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
165 HdrBad fcc "Header parity is INCORRECT !"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 fcb C$CR
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
167
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
168 CRCGood fcc "CRC is correct."
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 fcb C$CR
908
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
170
00afdd6aeb1f Modified option code to look for - in front of U
boisy
parents: 200
diff changeset
171 CRCBad fcc "CRC is INCORRECT !"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 fcb C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 end