16 bit Assembly
Home Feedback Site Map Instruction Index
Directory entries are 32 bytes in length.
The first entry is usually the disk label / name if it was set when the disk was formatted. Otherwise it can appear anywhere on the disk. It can be identified by the Label attribute 0x08h, there can only be one label per disk. So if any other entries have the same attribute they should be ignored, other instance are often paired with the sub folder attribute as well 0xA0h.
You can use these file records to display the Directory contents as shown below. The last values on the right of each entry are the start cluster as a decimal number. Deleted and Extended file names are not shown.
The image shows the file records in the sequence they appear in the Root Directory. Appart from the Start Cluster on the far right, which is shown here to assist with debugging any code.
File names and extensions are in capitals and they are padded with spaces with no dot.
The Date and Time indicate when the file was last modified. Extraction of the Time and Date, which are compressed into a 2 byte format and the 32 bit File Size are covered on a different page.
Modern operation systems alow users to recover deleted files by temporarily saving them in a recyling bin.
This is acheived by moving the file to the bin and renaming it, by changing the first letter of the file name to byte E5h. Then storing the first letter in the first byte for the Reserve block for that ROOT file record. This preserves the file, preventing it from being over-written.
When the user empties the Recyle bin the first byte of the Reserve block is over-written with a NULL. This effectively makes recovery of the file difficult, as can now be overwritten by future file operations.
Here is a summary of the tasks required.
Here is a summary of the tasks required.
If an error occurs stop further operations and display the appropriate error message. Then ask the user what they want to do next.