You are on page 1of 19

DEPARTMENT OF COMPUTER ENGINEERING

University College of Engineering & Technology


Bahauddin Zakariya University, Multan.

Manual Details

Subject MICROPROCESSOR AND Roll No.


INTERFACING 2019-CPE- 28
Session 2019 -2023
Pr. Hrs. per Week 3Hrs. (Pr) Practical No
Lab Instructor Engr. Muhammad UbaidUllah 5,6

Submission Details

Submitted by Nitasha Huma

Experiment #5
Objective: Writing, assembling and debugging a program in assembly language using
immediate addressing.

29
Theory:
Assembler:
An assembler is a type of computer program that interprets software programs written in
assembly language into machine language, code and instructions that can be executed by a
computer. Assemblers are similar to compilers in that they produce executable code. However,
assemblers are more simplistic since they only convert low-level code (assembly language) to
machine code. Since each assembly language is designed for a specific processor, assembling a
program is performed using a simple one-to-one mapping from assembly code to machine code.
Compilers, on the other hand, must convert generic high-level source code into machine code for
a specific processor.
AFD:
AFD stands for Advanced Full screen Debugger. AFD will debug the code assembled by NASM.
Immediate addressing:
Immediate addressing in an addressing form in which an immediate byte or word of data is
transferred from source into destination register. E.g.
MOV CH, 3AH Procedure:
1. First of all install the DOS Box.
2. Open the notepad and write required code in it as shown below:
(27+15) * (625-259) +191

3. Open the DOS Box and write in it as:

4. Press enter and you will get the output screen. Press F1 for the value stored in first
register and then again press it to obtain the value of second register and then obtain the
final result by pressing the same key.

30
Tasks:
Show the opcode and address in the following window.

31
Show the different windows present in the AFD window and also explain them.

32
33
Conclusion:
In this lab manual we learned about writing, assembling and debugging a program
in assembly language using immediate addressing. It included functions of addition and
multiplication along with the value over writing on it.

34
Experiment # 6
Objective: Write a program using direct/offset addressing and register indirect addressing.
Theory:
Register Indirect Addressing:
Transfer a byte or word between a register and memory location addressed by an index or base
register.
Example:MOV [BX], AX Direct
Addressing:
Move a byte or word between a memory location and a register.
Example:MOV [1234H], AX
Executable assembly program using direct/offset addressing.

Attach the screenshots of the above provided code results

35
36
Calculate the size of .lst file that must be equal to .com file?

The size of .com file of this Task#1 is about 39-bytes in both the .com and .lst files by
calculating them by their address in .lst file and from the properties of the .com file.

Executable assembly program using direct/offset addressing.

Attach the screenshots of the above provided code results

29
Calculate the size of .lst file that must be equal to .com file?
The size of .com file of this Task#2 is about 37-bytes in both the .com and .lst files by
calculating them by their address in .lst file and from the properties of the .com file.

30
Attach the screenshots of the above provided code results

29
Calculate the size of .lst file that must be equal to .com file?
The size of .com file of this Task#3 is about 37-bytes in both the .com and .lst files by
calculating them by their address in .lst file and from the properties of the .com file

30
Executable assembly program using direct/offset addressing.

Attach the screenshots of the above provided code results

29
Calculate the size of .lst file that must be equal to .com file?
The size of .com file of this Task#4 is about 36-bytes in both the .com and .lst files by
calculating them by their address in .lst file and from the properties of the .com file.

30
31
Lab Task:
A program that add 10 numbers and finally subtract 5 from answer using
direct/offset addressing
• Calculate .com file size
• Identify addition and subtraction step by step and show your result

1
2
3
Calculate the size of .lst file that must be equal to .com file?
The size of .com file of this Task is about 94-bytes in both the .com and .lst files by calculating
them by their address in .lst file and from the properties of the .com file.

Conclusion:
In this manual we have learnt about addressing modes applications in assembly
language programs. We have performed some program using direct/offset addressing and register
indirect addressing.

You might also like