Home »
Embedded Systems
Find square of an 8-bit number | 8085 Microprocessor
Here, we are going to learn how to find square of an 8-bit number using 8085 Microprocessor?
Submitted by Akash Kumar, on November 10, 2018
Problem: To find the square of an 8-bit number using 8085 Microprocessor.
Algorithm:
- Load the register H with value 20H and the register L with value 50H and the value of accumulator with 00H.
- Load the content of register B with the value taken from memory.
- Add the content of M in accumulator A and decrement the value of register B by one.
- Check if value of register B is 00 if yes then store result at memory location otherwise goto step 3.
- Terminate the program.
Program:
MVI L 50
MVI H 20
MVI A 00
MOV B, M
**ADD M
DCR B
JNZ **
STA 3050
HLT
Observation:
INPUT:
2050 : 03
OUTPUT:
3050 : 09
Hence, we successfully find the square of an 8-bit number using 8085 Microprocessor.