Information Technology Reference
In-Depth Information
// Step through the 11 characters in the short file name.
for (Character = 0; Character < 11; ++Character){
// Save bit 0's value in Bit7.
if (1 & Checksum) {
Bit7 = 0x80; }
else {
Bit7 = 0x0; }
// Shift the checksum right.
Checksum = Checksum >> 1;
// Add bit 7 to the result.
Checksum = Checksum | Bit7;
// Add the next character in the file name.
Checksum += ShortFileName[Character];
// Truncate the result to 8 bits.
Checksum = Checksum & 0xFF;
}
// The result after stepping through all 11 characters is the checksum.
return(Checksum);
}
Creating a Short File Name
To convert a long file name to a short file name to store in an 8.3 entry, fol-
low these steps:
1. Delete any spaces.
2. Delete any dots except the last dot before the extension, if present.
Search WWH ::




Custom Search