Академический Документы
Профессиональный Документы
Культура Документы
Experiment No. 4
4.1. AIM
Design an assembly language program to perform arithmetic operations using 8086
microprocessor.
4.2. OBJECTIVES
4.2.1. To understand the basic concepts of ALP development.
4.2.2. Development of algorithm for a given problem statement.
4.2.3. To develop flow chart using flowchart symbols.
4.2.4. Getting familiar with 8086 assembler.
4.2.5. To understand interfacing of 8086 with PC and procedure to load and execute the
program using assembler.
4.3. PRE-REQUISITES
4.3.1. Architecture of 8086 Microprocessor.
4.3.2. 8086 Internal Block Diagram.
4.3.3. Flag Register format of 8086.
4.3.4. Understanding of the arithmetic instruction.
4.5. THEORY
4.5.1. Register Organization of 8086
All Registers of 8086 are 16-bit
bit register .The GPR can be used as either 88-bit
bit or 16-bit. GPR
are used for holding data, variables and intermediate results temporarily. Other special
purpose registers are used as segment registers, pointers, index registers
register or as offset storage
registers for particular addressing modes.
Conditional Flags
1. CF Carry Flag Set if MSB has a carry.
2. PF Parity Flag Set if result has odd parity.
3. AF Auxiliary Carry Flag Used in BCD operations.
4. ZF Zero Flag. Set if result of arithmetic or logical operation is zero
5. SF Sign Flag Set if MSB of sign number is one.
6. OF Overflow. Flag Set when signed result id out range
Control Flags
Example:
MUL BH // (AX) ← (AL) × (BH)
4.6.9. DIV: Unsigned Division
This instruction divides an unsigned word or double word by a 16 bit or 8 bit operand. The
dividend must be in AX for 16-bit operation and divisor may be specified using any one of
the addressing modes except immediate. The result will be in AL (quotient) while AH will
contain the remainder. In case of double word dividend (32 bit), the higher word should be in
DX and lower word should be in AX. This instruction doesn’t affect any flag.
4.8.4. Write assembly language program for division operation of two 16-bit hexadecimal
numbers on 8086 microprocessor.
4.8.5. Write assembly language program for squaring a 16-bit hexadecimal number on 8086
microprocessor.
REFERENCES
[1]. A.K. Ray and K.M. Bhurchandi – Advanced Microprocessors and Peripherals, TMH
[2]. Douglas V.Hall - Microprocessor and Interfacing, TMH
[3]. Kennith J Ayala – 8086 Microprocessor, Pearson Education
[4]. Naresh Grover - Microprocessors: Comprehensive study, Dhanpat Rai Publictions