Select the product you need help with
How to Interpret 12-Bit FATsArticle ID: 65541 - View products that this article applies to. This article was previously published under Q65541 On This PageSUMMARY
The following is a description of 12-bit FAT field entries, followed
by an explanation of how to locate and interpret them.
MORE INFORMATION
=======================================================================
DESCRIPTION OF 12-BIT FAT FIELD ENTRIES
=======================================================================
=======================================================================
HOW TO LOCATE AND INTERPRET A FAT FIELD ENTRY
=======================================================================
HOW TO INTERPRET AN EVEN FAT FIELD NUMBERFormulaMultiply the FAT field number by 1.5. Read the next two bytes at the resulting offset in the FAT. Strip off the last four bits from the second byte and shift the result left 8 bits. OR the resulting value with the first byte. This will give you the entry stored in the FAT field. This entry could be a link or a last cluster marker depending on the value.ExampleYou are given the FAT field number 306 (132h).First, perform the following calculations:
(FAT field number) * 1.5 = FAT byte offset (N)
Read the 459th (N) and 460th (N + 1) bytes in the FAT table. Suppose
they contain the values 33h and 41h, respectively. The next field in
the chain would be as follows:
132h * 1.5 = 1CBh or 459
(byte N) OR ((strip last 4 bits of byte N + 1) shift left 8 bits) =
Next FAT field number
33h | ((41h & 0Fh) << 8) = 133h or the 307th field in the FAT
HOW TO INTERPRET AN ODD FAT ENTRY NUMBERFormulaOnce again, multiply the FAT field number by 1.5 and floor it down to the next integer less than the result. Read two bytes at the resulting offset. Take the second byte and shift it left four bits. Then, shift the first byte right four bits and AND the two together. The result is the entry for this FAT field.ExampleYou are given the FAT field number 307 (133h).Multiply and floor it:
floor ((FAT field number) * 1.5) = FAT byte offset (N)
Read bytes 460 (N) and 461(N + 1) from the FAT. In this example, they
contain the values 41h and 14h, respectively. To interpret the entry
perform the following:
floor (307 * 1.5) = 1CCh or 460
(byte N >> 4) OR (byte N + 1 << 4) = FAT Entry
(41h >> 4) | (14h << 4) = 144h or the 324th field in the FAT PropertiesArticle ID: 65541 - Last Review: November 26, 2003 - Revision: 3.0 APPLIES TO
|



Back to the top








