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