Activity No 8 Attributes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Activity No.

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.

2. Intended Learning Outcomes (ILOs):

After completion of this activity the students should be able to:

1.1 Display a text based on a specified position on a monitor screen


1.2 Create a program that involves text-based attributes.
3. Discussion :
The Screen
TITLE screen1.asm
.model small
The screen is typically has 80(0-79) columns x 25 (0-24). The columns and rows provide a grid of
.stack
addressable locations at any one of which the cursor can be set.INT 10h and Service 06h handles the
process of clearing the screen. .data
It is required to determine.code
the position of X and Y coordinates where the next character is to be
displayed.INT 10H Service 02H sets the start:cursor position.

mov ax, 0600h


The attribute byte in text mode determines
movbh, 00eh the characteristics of each displayed character. When a
mov cx,0
program set an attribute, it remains set; that is , all subsequent displayed character have the same attribute
movuse
until one operation changes it. You can dx, INT
0184fh10H functions to generate a screen attribute and perform
int 10h
such actions as scroll up or down, read attribute or character, or print / display attribute or character.

4. Resources: mov ah, 02


mov bh,0
Computer with 32-bit Operating System
TASM mov dh, 10
5. Procedure: mov dl,34
Sample Problem A. int 10h
1. Type the following program in Notepad.
mov ah,02
mov dl, 'T'
int 21h

mov ah,02
mov dl, 'I'
int 21h

mov ah,02
mov dl, 'P'
int 21h

mov ah, 4ch


int 21h
end start
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

mov ah, 06h


mov cl, 18h
movch, 00h
mov dl, 36h
mov dh, 18h
movbh, 40h
int 10h

mov ah, 06h


mov cl, 36h
movch, 00h
mov dl, 4fh
mov dh, 18h
movbh, 10h
int 10h

mov ah, 4ch


int 21h
end start

2. Save the program as screen2.asm.


3. Assemble and execute the program.
4. Analyze and record the output in Table 8.2.

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:

2. Modify program screen2.asm so that it will display the figure below:


3. Make an assembly program that will display the figure shown below. Save your file as Football.asm

8. CONCLUSIONS

8. Assessment (Rubric for Laboratory Performance):

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy