Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

8086 program to multiply two 16-bit numbers

  • Difficulty Level : Basic
  • Last Updated : 22 May, 2018

Problem – Write a program to multiply two 16-bit numbers where starting address is 2000 and the numbers are at 3000 and 3002 memory address and store result into 3004 and 3006 memory address.

Example –

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.


Algorithm –

  1. First load the data into AX(accumulator) from memory 3000
  2. Load the data into BX register from memory 3002
  3. Multiply BX with Accumulator AX
  4. Move data from AX(accumulator) to memory
  5. Move data from DX to AX
  6. Move data from AX(accumulator) to memory
  7. Stop

Program –

2000MOVAX, [3000][AX] <- [3000]
2004MOVBX, [3002][BX] <- [3002]
2008MULBX[AX] <- [AX] * [BX]
200AMOV[3004], AX[3004] <- AX
200EMOVAX, DX[AX] <- [DX]
2010MOV[3006], AX[3006] <- AX

Explanation –

  1. MOV is used to load and store data.
  2. MUL is used to multiply two 16-bit numbers.
  3. HLT is used to stop the program.
  4. AX is an accumulator which is used to store the result.
  5. BX, DX are general purpose registers where BX is used for multiplication and DX is used for result.
My Personal Notes arrow_drop_up
Recommended Articles
Page :