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

Name: Section:

Date Performed:
Date Submitted:
Instructor:

LABORATORY ACTIVITY NO. 3


DISPLAYING OUTPUT USING FUNCTION 02H, 06H AND 09H

1. Objective(s):

The activity aims to introduce outputs on assembly language

2. Intended Learning Outcomes (ILOs):

The students shall be able to create a program that displays characters or string of characters using

3. Discussion
In this activity, you will be introduced to the basic Output operations using assembly language.
You will use the DOS interrupt (INT 21H) function to display character or string.

Function Code 02h( Display a character)


Format: MOV AH, 02H
MOV DL,<VALUE>;<VALUE>=handles the character to be printed
INT 21h

Function Code 09h( Display a string)


Format: MOV AH, 09H
MOV DX,OFFSET <VAR_LABEL>
INT 21h

4. Resources:

1 Desktop Computer
TASM
5. Procedure:
DOS Display Function 02H and 06H:

*This program display the character HELLO using INT 21H function 02H and Function06H.

.model small
.stack
.code
begin
mov ah,02h
mov dl,' H '
int 21h
mov dl, ' E „
int 21h
mov dl, ' L '
int 21h
mov dl, ' L '
int 21h
mov dl, ' O '
int 21h
mov ah,4ch
int 21h
end begin

QUESTIONS:

1. What is the function of 02h?

______________________________________________________________________________

______________________________________________________________________________

2. If you change function 02h to 06h what will happen, and explain you answer?

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

3. What is the use of “int 21h”?

______________________________________________________________________________
______________________________________________________________________________

DOS Display Function 09H

TITLE: “Function 09h”

*This program display a message “WELCOME TO THE WORLD OF ASSEMBLY LANGUAGE”.

.model small
.stack
.data
msg1 db “WELCOME $”
msg2 db”TO THE WORLD OF ASSEMBLY LANGUAGE $”
.code
begin:
mov ax, @data
mov ds,ax
mov ah,09h
mov dx,offset msg1
int 21h
mov ah,09h
mov dx,offset msg2
int 21h
mov ah,4ch
int 21h
end begin
QUESTIONS:

1. What is the function of 09h in the program?

______________________________________________________________________________

2. What is the purpose of “ mov ds, ax”?

______________________________________________________________________________
______________________________________________________________________________

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

_____________________________________________________________________________

_____________________________________________________________________________

6. Data and Results:

a. Create programs that will display the name of your school and address at the center of the
screen. Followed by your full name, course, and section.

Sample Output:

Technological Institute of the Philippines

1338 Arlegui St., Quiapo, Manila

Juan Dela Cruz

CPE005/CPE42FB1

7. Conclusion:

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________