8086 program to multiply two 16-bit numbers

PROGRAM NO.5

OBJECT:Write a program to multiply two 16-bit numbers; result should be greater than 16 bits.
INSTRUMENT REQUIRED: 8086 Microprocessor Trainer Kit.
PROGRAM:

MEMORY LOCATION MACHINE CODE OPCODE OPERAND
0208 BE 00 02 MOV SI,0200H
020B 8B 04 MOV AX,[SI]
020D 46 INC SI
020E 46 INC SI
020F 8B 1C MOV BX,[SI]
0211 F7 E3 MUL BX
0213 BF 04 02 MOV DI,0204H
0216 89 05 MOV DI,[AX]
0218 47 INC DI
0219 47 INC DI
021A 89 15 MOV [DI],DX
021C F4 HLT  

DESCRIPTION:

To solve the  given objective we  have taken two hexadecimal numbers in the memory locations of 0200H and 0202H and multiplied them and stored the result in the memory location of 0204H and the remaining number in the DX register which is then transferred top the memory location of 0206H.

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 next number.
  4. Store the first number in the BX register using SI.
  5. Now apply MUL operation to multiply the numbers in the registers AX and BX and store the result in AXMove the destination index (DI) pointer to point to the memory location where the result is to be stored.

  1. Move the result from the AX register to the destination using DI.
  2. Move the destination index (DI) pointer to point to the memory location where the remaining 16 bit number is to be stored.
  3. Finally move the result from the DX register to the destination using DI and Halt.

INPUT VALUE:

MEMORY LOCATION VALUE
0200H 04
0201H 00
0202H 08
0203H 00
0204H 00
0205H 00
0206H 00
0207H 00

OUTPUT:

MEMORY LOCATIONVALUE
0204H20
0205H00
0206H00
0207H00

RESULT:The multiplication of the two numbers 0004H and 0008H yielded 0020H as the result and 0000H as the remaining bits.

COMMENTS:

  1. MOV SI, 0200H: 16 bit data can be moved using immediate addressing. 0200 is moved to source index.
  2. MUL BX: This instruction is used for the multiplication of 2 unsigned numbers. It multiplies the content of BX with AX and stores in AX.
  3. INC DI: 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:

8086 program to multiply two 16-bit numbers


Most Important Question for Exam

1. A directly accesible appointment calender is feature of a…..resident package




Answer is C)
Memory


2. The term gigabyte refers to




Answer is B)
1024 megabytes


3. Which is the bain of computer




Answer is C)
CPU

4. Which technology using the Microprocessor is fabricated on a sigle chip:




Answer is C)
MOS

5. CMOS Stand for:




Answer is D)
Metal oxide semiconductor

6. In which form CPU provide output:




Answer is C)
Digital signals

7. In Microprocessor one of the operand holds a special register called:




Answer is A)
Accumulator

8. Which register is a temporary storage location:




Answer is A)
B & C

9. PC Stand for




Answer is B)
Program Counter

10. The act of accuring instruction is reffered as the _____ the instruction:




Answer is C)
Fetching

11. How many bit of instruction on our simple computer consist of one ______:




Answer is B)
12-bit

12. How many parts of sigle address computer instruction:




Answer is D)
2

13. Single address computer instruction has two parts:




Answer is B)
C & D

14. LA stand for:




Answer is B)
Load Counter

15. ___________ Stores the instruction currently being executed:




Answer is B)
Instruction register

16. The status register is also called the ________:




Answer is C)
Both A & B

17. The area of memory wth address near zero are called:




Answer is A)
Low Memory

18. The processor user the stack to keep track of where the items are stored on it this by using the:




Answer is B)
Stack Pointer Register

19. The 16 bit register is sapreted into groups of 4 bit where each groups is called:




Answer is A)
Nibble

20. A nibble can be represented in the from of:




Answer is B)
Hexadecimal

21. The left side of any binary number is called:




Answer is D)
Most significant digit

22. A 16 bit address can generate _______addresses:




Answer is B)
65536

23. CPU can read and write data by using:




Answer is A)
Data Bus

24. Which bus transfer from the CPU to external device and oters that carry singles from extran device to the CPU:




Answer is C)
Control Bus

25. When memory read or I/O read active data is to the processor:




Answer is B)
Input

26. When memory write or I/O read are active data is from the microprocessor:




Answer is B)
Output

27. Which are the READ operation can in simple steps:




Answer is C)
All of these

28. DMA Stand for:




Answer is D)
Direct Memory Access

29. The Microprocessor system by using the __________ device interface:




Answer is D)
Both A & B

30. The standard I/O is also called:




Answer is B)
Isolated I/O

Related Link