CRC.BG93
ZXNet echo conference «code.zx»
From Dmitry Lomov → To Andrey Chervinsky 14 August 1999
Hello, Andrey!
Once, Fri Aug 13 1999 00:23, Andrey Chervinsky wrote to All about [CRC.BG93]:
AC> Sorry for being intrusive, but could you tell me
AC> as the control code is calculated by everyone's favorite VG93 microcircuit.
─ CODE.ZX (500:812/1.25) ────────────────────── ─────────────────────── CODE.ZX
Msg : 485 of 1193 Rcv From : Alexander Ageev
2:5030/675.10 Mon 18 Jan 99 12:53 To : Dmitry Lomov
Thu 24 Jun 99 00:03 Subj : Re: Mazda
─────────────────── ──────────────────── ──────────────────── ────────────────────
*** Answering a msg posted in area HARDWARE.ZX (HARDWARE.ZX).
Hello Dmitry!
Thursday January 14 1999 00:16, Dmitry Lomov wrote to Kirill Frolov:
KF>> Or maybe you know how 1818VG93 calculates CRC? Tell us!
DL> the same as MAC wrote :) I didn’t look into it in detail, I don’t know.
DL> has anyone done this? Uncle DARK, you had something
DL> is this? AU.
=== Beginning of crc.txt ===
ORG #6000
LD HL,TESTHD
LD DE,#B230
LD C,4
CALL CRC
LD HL,TESTHD
LD DE,#E295
LD C,0
CALL CRC RET
DW 0
; IN :HL=DATA; DE=INIT CRC; C=SIZE;OUT :DE=CRC ^^ #B230=HEADER #E295=DATA
CRC LD A,D:XOR (HL):LD D,A:INC HL
LD B,8
CRC2 SLA E:RL D:JR NC,CRC3
LD A,D:XOR #10:LD D,A
LD A,E:XOR #21:LD E,A
CRC3 DJNZ CRC2
DEC C:JR NZ,CRC RET
;---------------------------------------
TESTHD DB 0,0,1,1
TESTDT DS 256
=== End of crc.txt ===
Stinger.
───────────────────────вырезать─здесь─────(file: crc)───────────
Всего хорошего.
Дмитрий.
From Oleg Grigoriev → To Andrey Chervinsky 14 August 1999
Let your enemies, Andrey, die without sons!
Fri 13 Aug 1999 at 00:23, Andrey Chervinsky ═> All:
AC> Sorry for being intrusive, but could you tell me
AC> as the control code is calculated by everyone's favorite VG93 microcircuit.
────[ The Vg_Crc .C file begins here ]───────────────────────
ORG #8000
LD HL,BUFF0,C,#04
XOR A:CALL CRC
LD HL,BUFF1,C,#00
LD A,#01:CALL CRC
RET
BUFF0 DB #00,#00,#01,#01
BUFF1 DS #0100
;************************************************
;IN: [HL] =ADDR
; [C]=LENGTH
; [A] =TYPE; 0=HEADER, 1=DATA
;
;OUT: [DE] =CRC
;
CRC LD DE,#B230:OR A:JR Z,$+#05
LD DE,#E295
CRC1 LD A,D:XOR (HL):LD D,A
INC HL
LD B,#08
CRC2 SLA E:RL D:JR NC,CRC3
LD A,D:XOR #10:LD D,A
LD A,E:XOR #21:LD E,A
CRC3 DJNZ CRC2
DEC C:JR NZ,CRC1
RET
────[ The Vg_Crc .C file ends here ]────────────────────────
[WBR, Oleg. ]
[ 05:28 14 August XXXIV A.S. ]
75
From Yuri Ankudinov → To Andrey Chervinsky 14 August 1999
Once on 13-08-99 at 00:23:00, I saw an interesting letter, there was Andrey
Chervinsky
wrote to All. The subject of the letter was CRC.BG93...
...And so I also decided to dent my keyboard.
├┤e└└o, dear Andrey!
AC> Hi, All!
AC> Sorry for being intrusive, but could you tell me
AC> as the control code is calculated by everyone's favorite VG93 microcircuit.
Yes to your health...
Lecture: The highest noise immunity is cyclic
some control codes built on the basis of polynomials. Moreover,
The higher the degree of the polynomial, the more reliable the CRC. Test area
blocks of fixed length and frames must contain
inverted remainder of modulo two division by generator
polynomial of the set of bits of the service and information areas,
multiplied by X^K, where K is the size of the check area in bits.
Since when recording on floppy disks it is used
polynomial of 16th degree with a minimum code distance equal to
┌──────────────┐
│X^16+X12+X^5+1│
└──────────────┘
(in accordance with GOST 17422-82). In this case, the length of the block should
be no more than 2^15 bits. The same idea applies in
hard drives, and even in your favorite PC
RAR archiver. Now closer to the point... Bring the programsdemonstrating the method of calculating crc with the VG-93 controller and not
only to them...
....
LD IX, ARRAY ADDRESS
LD DE,ARAY LENGTH
CALL CRC16
....
CRC16
LD HL,0 ;INITIAL CONDITIONS
LD B,(IX+00)
LD C,8
M1 LD A,B
XOR H
SLA B
SLA L
JR C,M2
SLA H
JR M3
M2 SLA H
INC H
M3 BIT 7,A
JR Z,M4
INC L
JR M5
M4 LD A,20
XOR L
LD L,A
LD A,10
XOR H
LD H,A
M5 DEC C
JR NZ,M1
INC IX
LD B,(IX+00)
LD C,8
DEC DE
LD A,D
OR E
JR NZ,M1
RET
The CRC will be located at the exit in HL! I’ll warn you right away, for
the program takes time to work. After all, flop controllers do this
it's a hardware issue!!! So if there are brakes, reduce the degree
polynomial...
┌═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═┐
║With the be$t wi$he$ and regards,║
│ Sincerely yours, Yuri. │
╚─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─╝
(500:812/28.22)