Home »
Embedded Systems
Multiply Two 8-bit Numbers in 8086 Microprocessor
In this tutorial, we will learn how to multiply two 8-bit numbers in 8086 Microprocessor?
By Ayush Sharma Last updated : May 22, 2023
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
- Load data from offset 500 to register AL (first number)
- Load data from offset 501 to register BL (second number)
- Multiply them (AX=AL*BL)
- Store the result (content of register AX) to offset 600
- Stop
8086 program to multiply two 8-bit numbers
ADDRESS | MNEMONICS | COMMENTS |
400 | MOV SI, 500 | SI=500 |
403 | MOV DI, 600 | DI=600 |
406 | MOV AL, [SI] | AL<-[SI] |
408 | INC SI | SI=SI+1 |
409 | MOV BL, [SI] | BL<-[SI] |
40B | MUL BL | AX=AL*BL |
40D | MOV [DI], AX | AX->[DI] |
40F | HLT | END |
Explanation
- MOV SI, 500 set 500 to SI
- MOV DI, 600 set 600 to DI
- MOV AL, [SI] load contents of offset SI to register AL
- INC SI increase value of SI by 1
- MOV BL, [SI] load contents of offset SI to register BL
- MUL BL multiply contents of register AL and BL
- MOV [DI], AX store the result (contents of register AX) to offset DI
- HLT End.