CS 2650 - Computer Architecture

CS2650 Assembler Assignment #4
Due before class on April 15th


Display the course on one line, your name on the next and and the DOS Day, Date and Time (am/pm) next, with the three lines at the left edge of the display beginning on line 5.
 

Perform the following steps on a PC in DOS.  Be careful to follow the steps exactly so as not to completely erase the hard disk or<worse>!

Use NASM to create assembler code to display the information formatted as follows:


CS2650 Spring 2009
Hugo Reyes
Wednesday, April 23, 2009 - 08:30pm


After thoroughly testing your program, upload BOTH the files: CS2650P4.ASM and CS2650P4.COM using the web uploader.

Interrupt 10H  Function 02H
Position Cursor
Inputs:
AH 02H
BH Video Page (always 00h)
DH Row
DL Column
Outputs:
None

Interrupt 21H  Function 09H
Display String at present cursor location
Inputs:
AH 09H
DX Offset address of String to display
(The string must be terminated with a dollar sign $)
Outputs:
None

   
 

Interrupt 21H, Service 2aH
Read DOS Clock Date
Interrupt 21H, Service 2cH
Read DOS Clock Time
Registers on Entry:
    AH:    2AH
Registers on Entry:
    AH:   2CH
Registers on Return: 
    AL:    Day of Week (Sunday=0)
    CX:    Year (Binary)
 
    DH:    Month (Binary)
    DL:    Day (Binary)

   Registers on Return:
    CH:    Hour (Binary)
    CL:    Minutes (Binary) 
    DH:    Seconds (Binary)
    DL:    Hundredths of a Second (binary)



HINT:

To convert the parts of the date and time for display, you can use the DIV instruction to get the digits separated.

The DIV instruction performs 8 and 16 bit unsigned division.  A single operand is supplied (register or memory), which is assumed to be the divisor.  If the divisor is 8 bits long, AX is the dividend, AL the quotient, and AH the remainder.  If the divisor is 16 bits, DX:AX is the dividend, AX the quotient, and DX the remainder.

Example 1:    8-bit division  (18 / 10 = 1 remainder 8)

MOV AX, 18
MOV BL, 10
DIV BL

08h would be in AH, 01h in AL (try it!)

Example 2:    16-bit division (1999/1000 = 1 remainder 999)

MOV DX, 0
MOV AX, 1999
MOV CX, 1000
DIV CX

AX would contain 0001h and DX would contain 03E7h (999 decimal)