Question: Assembly chapter 7 top DOS file_time (Chapter 7, Supplied) Suppose the time field of a file directory entry uses bits 0-4 for 2-second increments, bits
top DOS file_time (Chapter 7, Supplied) Suppose the time field of a file directory entry uses bits 0-4 for 2-second increments, bits 5-10 for minutes, and bits 11-15 for hours (24-hour clock). Write a procedure named ShowFileTime that receives a binary file time value in the AX register and displays the time in hh:mm:ss format. For example, the binary 0001 0010 0000 0111 indicates a time of 02:16:14, in hh:mm:ss format: 00010 010000 00111 For simplicity, we want to input 4-digit hexadecimal and show its binary to verify. For this, you can call ReadHex and WriteBinB. Then you can call your ShowFileTime to display the file time. You may call WriteDec, WriteChar, and consider prefixed zeros. Run your program; the screen will be like this: c: Teaching\csc1241\KipIrvine\SixthEdition\ProgEx_SMlch07\Debug'project Please enter 16-bit hexadecimal (4-digit, e.g, 1207): A103 Your equivalent binary is 1010 0001 0000 0011 Your DOs file time is 20:08:06 c: VTeaching\csc1241\KipIrvine1SixthEdition\Prog_Ex_SM1ch07\Debug'project Please enter 16-bit hexadecimal (4-digit, e.g., 1207): 1207 Your equivalent binary is 0001 0010 0000 0111 Your DOS file time is 02:16:14 1207 our sog vzalent bia 1 00011 000 013 Any reusable helper procedure is preferred, such as displaying a leading zero character if the value of hours, minutes, or seconds less than 10, else displaying an original two digits. Advanced discussion (not required): A possible issue is display of invalid hours, minutes, and seconds. For a real world app, you do need to check hours 0 to 23, minutes 0 to 59, and seconds 0 to 59 from the the user input. Since purpose of this is to practice shift and rotate instructions, you can simply ignore the error checking without caring about these. top
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
