CS 2650 - Computer Architecture

Assembler Programming Project #3
Due Wednesday April 8, 2009 at 8:00am


Create a DOS clock program that displays your name, your computer name and, in between the two, continously displays 24-hour time until the user terminates operation by pressing a key on the keyboard.

The following will be displayed centered on your DOS window:



John Locke
14:24:35
HomePC




Be careful to follow the steps exactly so as not to completely erase the hard disk or

!

1. Use Notepad to create a file CS2650P3.ASM
2. Enter your program into this file as specified below
3. When ready, compile your program using the command.
nasmw CS2650P3.ASM -oCS2650P3.COM.

4. Save the program before compiling.
5. After thoroughly testing your program, upload the two files: CS2650P3.ASM and CS2650P3.COM by the due date.

Interrupt 21H Function 5EH, AL=0
Get Computer Name

INPUTS:
AH = 5Eh
AL = 0 (get computer name)
DX = Offset Address of string prepared to hold computer name (16 bytes)

OUTPUTS:
AH = Error code if problem.
CH = 0 if name not defined.

Int 10h Function 6
Scroll window area

INPUTS:
AH 06h
AL Number of lines to scroll (if zero, entire windows is blanked)
BH Attribute used for blanked area (Attribute byte defined below)
CH Row, upper left corner
CL Column, upper left corner
DH Row, lower right corner
DL Column, Lower right corner

OUTPUTS:
None

Interrupt 16H Function 01H
Check for Keystroke

INPUTS :
AH 01h

OUTPUTS:
Zero Flag
ZR indicates no keystroke
NZ indicates keystroke

Int 10h Function 13h
Write ASCII string

INPUTS:
AH 13h
AL Write mode Use 00h
BH Video Page Use 00h
BL Attribute byte (Attribute byte defined below)
CX Length of String
DH Row at which to write string
DL Column at which to write string
ES:BP Pointer to string

OUTPUTS:
None

Interrupt 1A, Service 2
Read Real-Time Clock Time

INPUTS :
   AH 02h

OUTPUTS:
    CH:    Hours (BCD)
    CL:    Minutes (BCD)
    DH:    Seconds (BCD)

Attribute Byte breakdown

Bit 0 - Blue component of foreground color
Bit 1 - Green component of foreground color
Bit 2 - Red component of foreground color
Bit 3 - Intensity component of foreground color
Bit 4 - Blue component of background color
Bit 5 - Green component of background color
Bit 6 - Red component of background color
Bit 7 - Intensity component of background color