Вы находитесь на странице: 1из 6

Name: Section:

Date Performed:
Date Submitted:
Instructor:

LABORATORY ACTIVITY NO. 4


SCREEN PROCESSING

1. Objective(s):

The activity aims to introduce screen processing in assembly language

2. Intended Learning Outcomes (ILOs):

The students shall be able to create a program that applies function 06h/07h and 02h.

3. Discussion
A typical screen has eighty (80) columns numbered from 0 to 79 and twenty five (25) rows numbered from
0 to 24. The columns and rows provide a grid of addressable locations at any one of which the cursor can
be set.

Interrupt 10h function 06 handles the process of clearing the screen.

The Screen display in an Assemble Program

AH = 06 AL = number of lines to blank at the bottom of the window


BH Display attributes to use for blank lines.
CH, CL Row and column number of the upper-left corner of the screen.
DH, DL Row and column number of the upper-right corner of the screen
Format: mov ah, 6
mov bh, 0
mov cx, 0000
mov dx, 184fH
int 10h
Color Chart

The background can display one out of eight colors and text can display one out of sixteen colors.

COLOR HEX CODE INTENSITY RED GREEN BLUE

Black 0 0 0 0 0

Blue 1 0 0 0 1

Green 2 0 0 1 0

Cyan 3 0 0 1 1

Red 4 0 1 0 0

Magenta 5 0 1 0 1

Brown 6 0 1 1 0

White 7 0 1 1 1

Gray 8 1 0 0 0

Light blue 9 1 0 0 1

Light green A 1 0 1 0

Light cyan B 1 0 1 1

Light red C 1 1 0 0

Light magenta D 1 1 0 1

Yellow E 1 1 1 0

High-intensity White F 1 1 1 1
4. Resources:

1 Desktop Computer
TASM
5. Procedure:
Text and Background Colors

Set the text and background colors where BH displays color respectively.

BACKGROUND COLOR TEXT COLOR HEX CODE MEANING

BL R G B I R G B

0 0 0 1 1 0 0 0 18 Blue Background color Gray


Text color

1 0 1 0 1 0 0 0 0A8 Green Background color Gray


Text color Blinking

0 1 0 0 0 0 0 0 40 Red Background color White


Text color

1 1 1 0 0 0 0 1 0E1 Brown Background color Blue


Text color

Setting the Cursor Position


Setting the cursor position is requirement to determine the position of X-Y coordinate where the nest
character is to be displayed.
Interrupt 10h function 02 set the cursor position
AH = 02
DH Row number (y axis)
DH, DL Column number (x axis)
The upper left corner of the screen is (0,0)
BH Display attributes to use for blank lines.
Format: mov ah, 2
mov bh, 0
mov dh, 10 ; y position
mov dl, 34 ; x poistion
int 10h

Video Function

Displaying characters “T(space), I(space), and P” at the center of the screen with BLUE
background

.model small
.stack
.data
.code
start:
mov ah, 06
mov bh, 10H
mov cx, 0
mov dx, 184fH
int 10h

mov ah, 02
mov bh, 0
mov dh, 10 ; y position
mov dl, 34 ; x position
int 10h

mov ah, 02
mov dl, 'T'
int 21h
mov dl, 20H
int 21h
mov dl, 'I'
int 21h
mov dl, 20H
int 21h
mov dl, 'P'
int 21h

mov ah, 4ch


int 21h
end start
1. What is the function of interrupt 10h?

______________________________________________________________________________

______________________________________________________________________________

2. What is the used of “mov ah,4ch” and when you removed it what will happen?

______________________________________________________________________________

______________________________________________________________________________

3. Change your background into four color horizontal “ Light Blue, Yellow, Magenda, and cyan” and
write down the code in the space provided for every color.

______________________________________________________________________________

______________________________________________________________________________

4. What is the used of “interrupt 21h”?

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

6. Data and Results:

DATA AND RESULT:

Create your own favorite value of resistor using interrupt function 10h that will display the
corresponding color value. Use string character printing and cursor positioning to display whatever you
want .information displayed in your resistor.
7. Conclusion:

Based from the results of the experiment, what general rule can you apply for?

FUNCTION 06
______________________________________________________________________________________________
______________________________________________________________________________________________
______________________________________________________________________________________

FUNCTION 7
______________________________________________________________________________________________
______________________________________________________________________________________________
______________________________________________________________________________________

Вам также может понравиться