Home »
Embedded Systems
Find square root of an 8-bit number |8085 Microprocessor
Here, we are going to learn how to find square root of an 8-bit number using 8086 Microprocessor?
Submitted by Akash Kumar, on November 10, 2018
Problem: To find square root of a number using 8085 Microprocessor.
Algorithm:
- Assign the value of register D and E with 01H.
- Load the number from memory.
- Subtract the content of accumulator with the content of register D.
- Check if the value of accumulator is zero if yes goto step 8.
- Increase the content of register by 02H.
- Increase the content of register by 01H.
- Goto step 3.
- Move the content of register E to accumulator.
- Store the result of register E to the memory.
- Terminate the program.
Program:
MVI E, 01
MVI D, 01
LDA 2050
**** SUB D
JZ ***
ADI D, 02
INC E
JMP ****
*** MOV A, E
STA 3050
HLT
Observation:
INPUT:
2050 : 09
OUTPUT:
2051 : 03
Hence, we successfully find the square root of an 8-bit number using 8085 Microprocessor.