You are on page 1of 10

COMPUTER ENGINEERING DEPARTMENT

Computer Systems Organization and Architecture Manual

ACTIVITY 2: Introduction to Turbo Assembler

2.1 Program Outcomes (POs) Addressed by the Activity


a. ability to apply knowledge of mathematics and science to solve engineering
problems
b. ability to design and conduct experiments, as well as to analyze and interpret data
c. ability to design a system, component, or process to meet desired needs within
realistic constraints such as economic, environmental, social, political, ethical, health
and safety, manufacturability, and sustainability, in accordance with standards
d. ability to identify, formulate, and solve engineering problems
e. ability to use techniques, skills, and modern engineering tools necessary for
engineering practice.
f. knowledge and understanding of engineering and management principles as a
member and leader in a team, to manage projects and in multidisciplinary
environments

2.2 Activity’s Intended Learning Outcomes (AILOs)


At the end of this activity, the student shall be able to:
a. Define Programming language
b. Identify the different Programming languages and program translators
c. Identify the different parts of the Assembly Language code
d. Develop and compile an Assembly Language code

2.3 Objectives of the Activity


The objectives of this activity are to:
a. To be able to learn the basics of turbo assembler.
b. To properly assemble and link a program using TASM and TLINK.
c. To be able to create an assembly language program using turbo assembler with SK as
editor.
d. Demonstrate and apply the use of the Service Function Call 02H of INT 21H in the
assembly language.
e. Execute of an assembly language program using service function call 02H, INT 21

2.4 Principle of the Activity

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 1


Writing a program in Assembly Language follows the same procedures as in
high- level languages such as Pascal.

1. Type the program instructions into the computer using a text editor, then save the
program on the disk.

2. Translate the text file into machine language program using an assembler. If the
assembler finds errors, correct them with the text editor and reassemble the program.

3. Convert the assembler output to an executable run module using the loader.

4. Execute the program.

5. Check the results. If they differ from what you expected, you must find the error or
bugs, that is, you must debug the program.

Text Editor
A text editor is a program that allows you to enter and prepare your program from
the ordinary keyboard into a computer readable form. It also allows you to save this file
into the disk for later use. The assembler and loader program require the inputs to be
saved files from the disk. A text editor can be any popular work processor or edit
program that can be produce pure ASCII text. As a standard convention, program written
in assembly language are usually given the filename with an extension of .ASM. This is
also the default filename extension that MASM searches.
Assembler
A program written in assembly language is translated to machine code by an
assembler. Assembler and the corresponding assembly language mnemonics are
generally limited to use with one particular microprocessor, which limits their portability,
or use on other machines. Today’s assembler do much more than translate assembly
language mnemonics into binary code.
Loader
Before the microprocessor can execute any machine instruction, it must first be
loaded into memory accessible to it. The loader is the program that actually takes the
machine instructions (object code) and places it in memory at the specified starting
address for execution. Loaders range from the very simple to the very complex.

2.5 Materials/Equipment

1 unit Personal Computer

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 2


DOS / Command Prompt
Text Editor (SK, Notrepad, Wordpad)
Assembler (TASM.EXE)
Linker (TLINK.EXE )
Storage unit

2.6 Circuit Diagrams / Figures / Source Codes (if Applicable)

Figure 1. Title

2.7 Procedure/s

1. Write the following program using SK’s notepad as your text editor using the filename
sam2.asm

.model small
.code
org 100h
s:
mov ah,2
mov dl, ‘R’
int 21h
mov dl, ‘E’
int 21h
mov dl, ‘D’
int 21h
int 20h
end s

2. Save the program by pressing F2.

3. Go to the DOS prompt and then assemble the program by using the command below: H:\
[your subdirectory]>tasm sam2.asm

4. If there are warnings and errors in assembling process go back to the source code and fix
those errors. If no error occur proceed to the next step.

5. Link the program by using the command : H:\[your subdirectory]>tlink/t sam2

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 3


There should be no BAD OBJECT FILE message in the linking process, if bad
object file occur assemble the program once again.

6. Execute the program by simple typing the filename on the prompt. What is the output of
the given program?

___RED__
7. Modify sam2.asm. The output should be:
R
E
D

Asm file

exp3.asm

Asm file Back up

exp3.asm

2.8 Activity Report

Section: Date Performed:


Course Code: Date Submitted:
Course Title:
Instructor:
Group No.: Activity No.:
Group Members: Signature:
1.
2.
3.
4.
5.

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 4


2.8.1 Data and Results

1. Given the sample output coming from your instructor, write down and compile the
required program that will provide the expected sample output using expt2.com as
the filename.

2. Encode the program.

3. Ask your instructor to check your work

4. Save the program to your data disk..

FIRST NAME ONLY

EXPT2.ASM

FULL NAME

EXPT22.ASM

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 5


1. What is the difference between the ESC and CTRL+ALT when moving from SK to DOS.

Using ESC in DOS cancels the current operation/ instruction, while CTRL+ALT in SK,

Lets you use or navigate the menu in SK._______

2. How many files are created in using turbo assembler?

____4 FILES_______

3. What are those files?

.asm file, 3D object file, MAP file, and MS-DOS application_____________________

4. Which files are created in assembling process?

.asm file and 3D object___________________________________

5. Which files are created in linking process?

The MS-DOS Application_________________________________

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 6


6. What are the purpose of /t in linking process?

It bundles all created object files into executable files. _______

7. Compare the use of DEBUG and TURBO ASSEMBLER in assembly language


programming.

DEBUG is pure hard coding in terms of assembly programming. TURBO ASSEMBLER

On the other hand, it makes coding of assembly programming easier, because it has built-

In commands to make the coding part easier._____

8. What is the purpose of org 100h in your program?

To assign the number of bytes allotted for the program_________________________

2.8.2 Calculations

.model small .model small


.code .code
org 100h org 100h
g: g:
mov ah, 2 mov ah, 2 mov ah, 2
mov dl,’G’ mov dl,’G’
int 21h int 21h mov dl,’Z’
mov dl,’A’ mov dl,’A’ int 21h
int 21h int 21h mov dl,’A’
mov dl,’B’ mov dl,’B’ int 21h
int 21h int 21h mov dl,’M’
mov dl,’R’ mov dl,’R’ int 21h
int 21h int 21h mov dl,’O’
mov dl,’I’ mov dl,’I’ int 21h
int 21h int 21h mov dl,’R’
mov dl,’E’ mov dl,’E’ int 21h
int 21h int 21h mov dl,’A’
mov dl,’L’ mov dl,’L’ int 21h
int 21h int 20h
mov dl,’ ’
ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER
int 21h 7
mov dl,’E’
int 21h
int 20h

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 8


2.8.3 Observations (if applicable)

__________________________________________________________________

__________________________________________________________________

__________________________________________________________________

__________________________________________________________________

2.8.4 Conclusion/s

In this experiment, using the TURBO ASSEMBLER is easier than DEBUG,

because, DEBUG is hard coding all the time. TURBO ASSEMBLER is easier

because it’s like an IDE for assembly language.

2.8.5 Rating (include Rubric)

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 9


Criteria Grade

Activity Conduct (1-5)

Correctness of Command(s)/Program(s) (1-5) x 2

Completeness of Tasks (1-5)

Data Analysis and Results Interpretation (1-5)

Total Score

Mean Score = (Total Score / 5)

Percentage Score = (Total Score/25) * 100


Other Comments:

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 10

You might also like