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