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

COMPUTER ENGINEERING DEPARTMENT

Computer Systems Organization and Architecture

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?

RED

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


R
E
D

2.8 Activity Report

Section: W391 Date Performed:09/24/20


Course Code: ITECOMPSYSL Date Submitted: 09/24/20
Course Title:
Instructor:
Group No.: Activity No.: 2
Group Members: Signature:
1. Rabe, Kim C.
2.
3.
4.
5.

2.8.1 Data and Results

1. Write a program that will provide the expected sample output given below using
expt2.asm as the filename.

FEU Tech

Dela Cruz, Juan A. / B.S. CpE / 201900156

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 4


2. Provide a screen shot of the output and program code.
Output Screen Shot:

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 5


ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 6
ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 7
ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 8
3. What is the difference between the ESC and CTRL+ALT when moving from SK to
DOS.

ESC lets you go back while the CTRL + ALT lets you advance

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

5. What are those files?


The files that are created using turbo assembler are ASM, MAP and 3D Object files

6. Which files are created in assembling process?

.ASM and .MAP


7. Which files are created in linking process?

The file that is created in linking process is the .OBJ file


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

-To create the COM file

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


programming.

-Debug is more pure/raw and turbo assembler makes programming easier.


10. What is the purpose of org 100h in your program?
-ORG defines where the machine code is to place in memory. As for OG 100H this
deals with 80x86 COM program format which consist of only one segment of max.

2.8.2 Calculations (if applicable)

2.8.3 Observations

-I observed that tlink and tasm are important commands to execute the program.

2.8.4 Conclusion/s

ACTIVITY 2: INTRODUCTION TO TURBO ASSEMBLER 9


-I therefore conclude that turbo assembler is much more easier than debug
because it lets you see the line number and column number.

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 10

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