annotate level1/cmds/verify.asm @ 908:00afdd6aeb1f

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