Professional Documents
Culture Documents
information about
a) To create various types of report and get more knowledge about how to make report. We have chosen
this micro project to get knowledge about detect the amount of alcohol.
1. The goal of preventing or reducing alcohol use among young adolescents by using
a multilevel, communitywide approach
*************
A
PROJECT REPORT
ON
DIPLOMA IN
COMPUTER ENGINEERING
SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI
SUBMITTED BY
CERTIFICATE
This is to vertify that the project report entitled “Assembly Language Programing” Was
successfully completed by Student of fourth semester Diploma in computer engineering.
Pokharkar Sangram
Pokharkar Omkar
Pawar Om
In partial fulfillment of the requirements for the award of the Diploma in Computer
engineering and submitted to the Department of Computer of Samarth Polytechnic,
Belhe work carried out during a period for the academic year 2021-22 as per curriculum
.
This project is done as a fourth semester project, as a part course titled “Assembly Language
Programing”
I am really thankful to our course the Principal Prof. Kapile A. S. and the HOD Prof. Kshirsagar S.B
Samarth Polytechnic, Belhe for his invaluable guidance and assistance, without which the accomplishment
of the task would have never been possible.
I also thank Prof. Thorat for giving this opportunity to explore into the real world and realize the
interrelation without which a Project can never progress. In our present project I have chosen the topic-
“Assembly Language Programing”.
I also thankful to parents, friend and all staff of Computer engineering department, for providing us relevant
information and necessary clarifications, and great support.
Pawar Om Vijay
ASSEMBLY LANGUAGE PROGRAMMING TO ADD,SUB,MUL,DIV OF TWO 8 BIT BCD NUMBERS
CHAPTER 1 INTRODUCTION
Assembly level programming is very important to low-level embedded system design is used to
access the processor instructions to manipulate hardware. It is a most primitive machine level
language is used to make efficient code that consumes less number of clock cycles and takes less
memory as compared to the high-level programming language. It is a complete hardware oriented
programing language to write a program the programmer must be aware of embedded hardware.
Here, we are providing basics of assembly level programming 8086.
CHAPTER 2
Problem statement:
Write a program in 8086 microprocessor to find out the addition of two 8-bit BCD numbers, where
numbers are stored from starting memory address 2000 : 500 and store the result into memory
address 2000 : 600 and carry at 2000 : 601.
Algorithm:
Flow Chart:
Program:
Explanation:
OUTPUT OF PROGRAM:
Address Data
… …
600 25
601 01
… …
CHAPTER 3
Algorithm –
1. Load data from offset 500 to register AL (first number)
2. Load data from offset 501 to register BL (second number)
3. Subtract these two numbers (contents of register AL and register BL)
4. Apply DAS instruction (decimal adjust)
5. Store the result (content of register AL) to offset 600
6. Set register AL to 00
7. Add contents of register AL to itself with carry (borrow)
Flow chart:
Program –
Explanation –
1. MOV AL, [500] load data from offset 500 to register AL.
2. MOV BL, [501] load data from offset 501 to register BL.
3. SUB AL, BL subtract contents of registers AL AND BL.
4. DAS decimal adjust AL.
5. MOV [600], AL store data from register AL to offset 600.
6. MOV AL, 00 set value of register AL to 00.
7. ADC AL, AL add contents of register AL to AL with borrow.
8. MOV [601], AL store data from register AL to offset 601.
9. HLT End.
Output of program :
Address Data
… …
600 74
601 00
… …
CHAPTER 4
Algorithm –
1. Load data from offset 500 to register AL (first number)
2. Load data from offset 501 to register BL (second number)
3. Multiply them (AX=AL*BL)
4. Store the result (content of register AX) to offset 600
5. Stop
Flowchart :
Program –
Explanation –
1. MOV SI, 500 set 500 to SI
2. MOV DI, 600 set 600 to DI
3. MOV AL, [SI] load contents of offset SI to register AL
4. INC SI increase value of SI by 1
5. MOV BL, [SI] load contents of offset SI to register BL
6. MUL BL multiply contents of register AL and BL
7. MOV [DI], AX store the result (contents of register AX) to offset DI 8. HLT End.
Output
Address Data
… …
600 1D
601 16
… …
CHAPTER 5
Problem – Write an assembly language program in 8086 microprocessor to divide a 16 bit number by an 8 bit
number. Example –
Algorithm –
1. Assign value 500 in SI and 600 in DI
2. Move the contents of [SI] in BL and increment SI by 1
3. Move the contents of [SI] and [SI + 1] in AX
4. Use DIV instruction to divide AX by BL
5. Move the contents of AX in [DI].
6. Halt the program. Flowchart :
OPERATIONS
Instruction fetching
Data operation
Stack operation
String as a source
String as a destination
0400
0403
0406
0408
0409
040B
040D
040F
SEGMENT
REGISTER OFFSET
INC SI SI <- SI + 1
DIV BL AX <- AX / BL
AX
6. DIV BL divide the content of AX by BL, after execution of this instruction the quotient get stored in AL and
remainder in AH
7. MOV [DI], AX moves the content of AX to [DI]
8. HLT stops executing the program and halts any further execution
OUTPUT:
Address Data
… …
600 D1
… …
CHAPTER 6
. Time Efficient
For starters, Assembly Language is the lowest level of coding. Hence, Compiler takes almost no time to decode it.
As we already discussed, for Assembly Language, you need to use the registers for operations. Since they are used
for temporary storage purposes, you don’t need to bother about the consumption of memory.
At this point, I am already assuming that you know your system only understands two things – 0 or 1. Multiple
combinations of both the numbers indicate the computer’s processor: what needs to be done and when to be done?
Since, Machine Language is the computer understandable language. So, to better understand Machine Language you
need to have a command over Assembly Language.
Well, ISR is a dedicated routine invoked by an Interrupt. Be it Software Interrupt, Hardware Interrupt or Timer
Interrupt. If you have the knowledge of Assembly Language, you can easily alter and change the ISR according to
your needs or preferences.
As we have already learnt, Assembly Language is majorly used to program embedded systems such as ovens. Using
it, one can easily take advantage of time and storage efficiency along with the ability to manipulate the hardware.
If you have learnt Assembly Language well, you can easily manipulate hardware accordingly.
CHAPTER 7
Advantages & disadvantages goes parallelly. Now that we have seen major benefits of learning Assembly Language,
here are some drawbacks with it:
Well, long programs written in Assembly language are difficult to execute and the results are mostly negative.
Therefore, you cannot code in Assembly Language on Small-Sized or dated systems
Assembly Language programming may differ from Microprocessor to another microprocessor. The written program
is not independent of the portable platform.
3. Difficult To Understand
Unlike other programming languages, to write in Assembly language, one must know the internal structure of the
microprocessor to proceed further.
CHAPTER 8
CONCLUSION
Many computer programming languages are used for the development of applications and software programs, the
importance of assembly language cannot be underestimated. With Assembly Language, you’ll be able to run complex
tasks in simpler ways, doesn’t track much of memory locations and it is relatively faster in speed as execution time is
quite less. Additionally, the assembly language programming is transparent in nature as compared to other highlevel
languages. This is because it has a small number of operations. Therefore, it finds many users in algorithm analysis.
It makes it easy to debug. Moreover, it is the language that the CPU easily recognizes. Since every section of binary
caters to a certain meaning, it can be somewhat easy to understand, in comparison to other high-level languages!
CHAPTER 9
REFERENCES
The assembler takes machine-language instructions and translates them into machine object code.