Activity No 8 Attributes 1
Activity No 8 Attributes 1
8
ATTRIBUTES
Course Code: CPE005 Program:
Course Title: Computer Systems Organization with Assembly Date Performed:
Language
Section: Date Submitted:
Name: Instructor:
1. Objective:
This activity aims to demonstrate cursor positioning and text-based attributes in Assembly.
The screen is typically has 80(0-79) columns x 25 (0-24). The columns and rows provide a grid of
addressable locations at any one of which the cursor can be set.INT 10h and Service 06h handles the
process of clearing the screen.
It is required to determine the position of X and Y coordinates where the next character is to be
displayed.INT 10H Service 02H sets the cursor position.
The attribute byte in text mode determines the characteristics of each displayed character. When a
program set an attribute, it remains set; that is , all subsequent displayed character have the same attribute
until one operation changes it. You can use INT 10H functions to generate a screen attribute and perform
such actions as scroll up or down, read attribute or character, or print / display attribute or character.
4. Resources:
Computer with 32-bit Operating System
TASM
5. Procedure:
Sample Problem A. TITLE screen1.asm
1. Type the following program .model small in Notepad.
.stack
.data
.code
start:
mov ah, 02
mov bh,0
mov dh, 10
mov dl,34
int 10h
mov ah,02
2. Save the program as screen1.asm.
3. Assemble and execute the program.
4. Analyze and record the output in Table 8.1.
Sample Problem B.
1. Modify program screen1.asm, replace line number 15 with “mov bh,0ch”.
2. Analyze and record the output in Table 8.2.
3. How is your output different from before? Why?
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
Sample Problem C.
1. Modify program screen1.asm, replace line number 2 with “mov bh,1bh”.
2. Analyze and record the output in Table 8.3.
3. How is your output different from before? Why?
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
Sample Problem D.
1. Type the following program in Notepad.
TITLE screen2.asm
dosseg
.model small
.stack
.code
start:
mov ax, 0b800h
moves, ax
mov ah, 06h
mov cl, 00h
movch, 00h
mov dl, 18h
mov dh, 18h
movbh, 20h
int 10h
6. DATA ANALYSIS:
Table 8.1- Output of screen1.asm Table 8.2- Output of screen2.asm
7. PROBLEMS:
1. Modify screen2.asm. Change the background into four-color vertical “Light blue, yellow, magenta
and Cyan” and write down the name of the color on the space provided for every color.
Sample Output:
8. CONCLUSIONS