CSc 343 Computer Organization and Programming
Fall Quarter 1997
Quiz #4 (19 November 1997, Wednesday) with Solutions

  1. Within each entry in a disk directory, what is the offset of the file size?
    
        1CH to 1FH
    
    
  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?
    
        Subdirectory
    
    
  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?
    
        6 December 1987
    
    What is the starting cluster number?
    
        4
    
    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 -- F8 stands for Hard Disk
    
    How many files are described by this portion of the FAT?
    
        3
    
    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  ah,42h
        mov  al,00h
        mov  bx,handle
        mov  cx,0
        mov  dx,3712
        int  21h
    
    
  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
    
          Size of the file in bytes
    


Raj Sunderraman
Posted: 19 November, 1997