Solution To Assignment BC100201647 Question # 1

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

SOLUTION TO ASSIGNMENT BC100201647 Question # 1: Suppose you are assigned to set date and time of a DOS maintained clock

of your system through DOS interrupt. Which interrupt would you use in this case? Also clearly state the service number and attributes of that specific interrupt. Solution:INT 21 SET SYSTEM DATE AH = 2Bh Receives: CX = year (1980-2099) DH = month (1-12) DL = day (1-31) Returns: AL = 00h if the date is valid AL = FFh invalid date, system date unchanged NOTE :-( 2B Set system date. Receives: CX =year, DH =month, and DL =day. Returns: AL =0 if the date is valid.) INT 21 SET SYSTEM TIME AH = 2Dh Receives: CH = hour CL = minute DH = second DL = 1/100 seconds Return: AL = 00h if the time is valid AL = FFh invalid time, system time unchanged 2D Set system time 2B Set system date

NOTE :-( 2D Set system time. Receives: CH =hour, CL =minutes, DH =seconds, and DL =hundredths of seconds. Return s: AL =0 if the time is valid.)

Question # 2: Suppose you are required to format a specific disk track through BIOS interrupt. Which interrupt would you use in the mentioned case? Moreover clearly state the service number and attributes of that specific interrupt. Solution:INT 13 - FLOPPY - FORMAT TRACK AH = 05h AL = number of sectors to format CH = track number DH = head number DL = drive number ES: BX -> address field buffer Return: CF set on error CF clear if successful AH = status

INT 13 - FIXED DISK - FORMAT TRACK AH = 05h AL = interleave value (XT-type controllers only) ES: BX -> 512-byte format buffer The first 2*(sectors/track) bytes contain F, N for each sector F = sector type 00h for good sector 20h to unassign from alternate location 40h to assign to alternate location

80h for bad sector N = sector number CH = cylinder number (bits 8, 9 in high bits of CL) CL = high bits of cylinder number (bits 7, 6) DH = head DL = drive Return: CF set on error CF clear if successful AH = status code

You might also like