ITECOMPSYSL Activity 2 - Introduction To Turbo Assembler

You might also like

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

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


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

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 1


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


DOS / Command Prompt
Text Editor (SK, Notrepad, Wordpad)

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 2


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

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

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 3


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

________________________________________

7. Modify sam2.asm. The output should be:


R
E
D

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.

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..

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 4


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

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

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

________________________________________________________________________

3. What are those files?

________________________________________________________________________

________________________________________________________________________

4. Which files are created in assembling process?

________________________________________________________________________

________________________________________________________________________

5. Which files are created in linking process?

________________________________________________________________________

________________________________________________________________________

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

________________________________________________________________________

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 5


________________________________________________________________________

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


programming.

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

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

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

2.8.2 Calculations

2.8.3 Observations (if applicable)

__________________________________________________________________

__________________________________________________________________

__________________________________________________________________

__________________________________________________________________

2.8.4 Conclusion/s

__________________________________________________________________

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 6


__________________________________________________________________

__________________________________________________________________

__________________________________________________________________

2.8.5 Rating (include Rubric)

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 7

You might also like