×

Embedded Systems Tutorial

AVR Microcontroller

8051 Microcontroller

8085 Microprocessor

8086 Microprocessor

8255 Microprocessor

Embedded Systems Practice

Find Square Root of an 8-bit Number in 8085 Microprocessor

In this tutorial, we will learn how to find the square root of an 8-bit number using 8086 Microprocessor? By Akash Kumar Last updated : May 14, 2023

8085 program to find square root of an 8-bit number

Given an 8-bit number, we have to write 8085 program to find its square root.

Algorithm

  1. Assign the value of register D and E with 01H.
  2. Load the number from memory.
  3. Subtract the content of accumulator with the content of register D.
  4. Check if the value of accumulator is zero if yes goto step 8.
  5. Increase the content of register by 02H.
  6. Increase the content of register by 01H.
  7. Goto step 3.
  8. Move the content of register E to accumulator.
  9. Store the result of register E to the memory.
  10. 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.




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.