CSc 343
Computer Organization and Programming
Spring Quarter 1998
Solutions to Quiz #5 (1 June 1998, Monday)

1. Within each entry in a disk directory, what is the
   offset of the file size?

   1Ch

2. Which area of the disk includes information about its cluster size,
   number of tracks per side and number of sectors per track?

   Boot Record

3. If a directory entry has an attribute of 10H, what kind of entry
   is it?

   A sub-directory

4. Consider the following dump of a directory entry. 

   46 49 4C 45 31 20 20 20 - 41 53 4D 20 00 00 00 00
   00 00 00 00 00 00 A2 A6 - 86 0F 04 00 20 00 00 00

   What is the file name?   FILE1
   What is the file extension? ASM
   What does the file attribute signify? Archive file
   What time was the file last created or changed? 20.53.04
   What date was the file last created or changed? 12/6/1987
   What is the starting cluster number? 0004h
   What is the file size?  32 bytes

5. Suppose that the DIR command shows 2625536 bytes free on a disk.
   After a file of length 283 bytes is deleted, DIR now shows
   2629632 bytes free. How many sectors are there per cluster?

   8 sectors per cluster

6. What would be the attribute byte for a file that is both
   read-only and hidden? Give your answer in hex.

   03h

7. Suppose that a disk has the following 16-bit FAT:

   F8 FF FF FF 03 00 04 00 FF FF 06 00 FF FF 08 00 FF FF

   What is the meaning of the F8 byte at the beginning?

     Media descriptor indicates hard disk.

   How many files are described by this portion of the FAT?

   3 files

   What is the size of the first file (in clusters)?

   3 clusters

8. Write a piece of code that positions the file pointer
   to the beginning of the 30th record in a file consisting
   of several hundred fixed-length records of size 128 bytes.

     mov  ax,4200h
     mov  bx,handle
     mov  dx,3712
     mov  cx,0
     int  21h
     jc   error

9. What is contained in DX:AX after the following piece of code is 
   executed on a file with handle = 33?

  mov  ah,42h
  mov  al,2
  mov  bx,33
  mov  cx,00
  mov  dx,00
  int  21h

  Answer:  file size