Addition of two 16 bits numbers without carry using 8086 Microprocessor

PROGRAM NO.1

OBJECT: Write a program to add two 16 bit hexadecimal numbers without carry.
INSTRUMENT REQUIRED: 8086 Microprocessor Trainer Kit.
PROGRAM:

MEMORY LOCATION MACHINE CODE OPCODE OPERAND
0206 BE0002 MOV SI,0200H
0209 8B04 MOV AX,[SI]
020B 46 INC SI
020C 46 INC SI
020D 8B1C MOV BX,[SI]
020F 03C3 ADD AX,BX
0211 BF0402 MOV DI,0204H
0214 8905 MOV [DI],AX
0216 F4 HLT  

DESCRIPTION:

To solve the given objective, we have taken two hexadecimal numbers in the memory locations of 0200H and 0202H and added them and stored the result in the memory location of 0204H.
To solve the given objective, we have taken the following steps:

  1. Move the source index register (SI) pointer to the location of the first number.
  2. Store the first number in the AX register using SI.
  3. Double increment the SI pointer to point to the memory location of the second number.
  4. Store the second number in the BX register using SI.
  5. Now apply ADD operation to add the numbers in the registers AX and BX and store the result in AX.
  6. Move the destination index (DI) pointer to point to the memory location where the
    result is to be stored.
  7. Finally move the result from the AX register to the destination using DI 8. HLT to Halt or End the program.

INPUT VALUE

MEMORY LOCATION VALUE
0200H 10
0201H 3A
0202H 1C
0203H 2B
0204H 00
0205H 00

OUTPUT

MEMORY LOCATION VALUE
0204H2C
0205H65

RESULT:  The addition of the two hexadecimal numbers 3A1CH and 2B1CH yielded 652CH

COMMENTS:

1.  MOV SI, 0200H: 16 bit data can be moved using immediate addressing . 0200 is moved to source index.

2.  ADD AX, BX: contents in the accumulator and the base register are added.

3.  INC SI: The content of a specified 8-bit or 16-bit register or memory location(s) is incremented by one by this instruction.

4.  HLT: This instruction stops program execution. The processor stops fetching and executing instructions.

FLOWCHART:

Addition of two 16 bits numbers without carry using 8086 Microprocessor


Most Important Question for Exam

1. Which is the Microprocesor comprises?




Answer is C)
All of these


2. There are Primarly two types of register?




Answer is D)
A and B


3. What is the store by register?




Answer is D)
Data

4. Name of typical dedicated register is:




Answer is C)
All of these

5. Accumulator based Microprocessor example are:




Answer is D)
A and B

6. BCD Stand for:




Answer is D)
Binary codec decimal

7. A set of register which contain are:




Answer is A)
All of these

8. Which is used to store critical pieces of data during subroutines and interrupts:




Answer is D)
Stack

9. The Data in the stack is called:




Answer is D)
Pushing Data

10. The external system bus architecture is created ursing from _______ architecture:




Answer is A)
Von Neumann

11. The Processor 80386/80486 and the Pentium Processor uses _______ bits address bus:




Answer is C)
32

12. Which is not the control bus signal:




Answer is B)
RESET

13. PROM Stand for:




Answer is B)
Programmable read-only memory

14. EPROM Stand for




Answer is D)
Erasable Programmable read only memory

15. Each memory location has:




Answer is A)
Both B & C

16. Which is the type of Microcomputer memory:




Answer is C)
All of these

17. Secondary memory can store________




Answer is B)
All of these

18. Secondary memory is also called_______:




Answer is C)
Both B & C

19. Customized ROMS are called:




Answer is B)
Mask ROM

20. The RAM which is crated using bipolar transistors is called:




Answer is C)
Static RAM

21. Which type of RAM needs regular reffered:




Answer is B)
Dynamic RAM

22. Which RAM is created using MOS transistor:




Answer is D)
Dynamic RAM

23. A Microprocessor retries instruction from:




Answer is D)
Main Memory

24. The lower red curvy arrow show the CPU places the address extracted from the memory location _______.




Answer is B)
Address Bus

25. The CPU send out a _____ signal to indicate the valid data is available on the data bus:




Answer is A)
Write

26. The CPU moves the _______ signal to complete the memory write operation:




Answer is B)
Read

27. BIU Stand for:




Answer is B)
Bus interface unit

28. EU Stand for:




Answer is B)
Execution unit

29. Which are the four categories of registers:




Answer is C)
All of these

30. Eight of register are known ar:




Answer is C)
General-purpose register

Related Link