Home » Embedded Systems

Multiply two 8 bits number | 8086 Microprocessor

Here, we are going to learn how to multiply two 8 bits numbers using assembly program in 8086 Microprocessor?
Submitted by Ayush Sharma, on October 31, 2018

Problem statement:

Write a program in 8086 microprocessor to multiply two 8-bits numbers, where numbers are stored from offset 500 and store the result into offset 600.

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

Program:

ADDRESSMNEMONICSCOMMENTS
400MOV SI, 500SI=500
403MOV DI, 600DI=600
406MOV AL, [SI]AL<-[SI]
408INC SISI=SI+1
409MOV BL, [SI]BL<-[SI]
40BMUL BLAX=AL*BL
40DMOV [DI], AXAX->[DI]
40FHLTEND

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.





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.