Changes

Jump to: navigation, search

765 FDC

279 bytes removed, 10 July
/* FDC Track Format */
[[File:FDC765 Track Format.png]]
The CRC-16 generator used is initialised to FFFF. It is updated byte by the FDC byte and uses the classical CCITT polynomial G(x)=x^16 + x^12 + x^5 + 1-CRC16 algorithm. It is written after the ID and data field high byte and then low byte.
Or in pseudo code:
<pre>
# x^16 is not explicitly stored in the magic number 0x1021, it's implicit in CRC-16 calculations
def crc16_ccitt(crc, byte):
crc ^= (byte << 8)
for _ in range(8):
if crc & 0x8000:
crc = (crc << 1) ^ 0x1021
else:
crc = crc << 1
crc &= 0xFFFF
return crc
</pre>
<br>
6,121
edits