Find Square Root of a number | 8086 Microprocessor

In this tutorial, we will learn how to find square root of a number using 8086 Microprocessor? By Akash Kumar Last updated : May 22, 2023

Problem Statement

Write a program in 8086 microprocessor to find square root of a number.

Algorithm

  1. Move the firstnumber in register AX.
  2. Assign the value of register CX as 0000 and register BX as FFFF.
  3. Add 0002 to value of register BX.
  4. Update the value of register CX by one.
  5. Subtract the content of register AX and BX.
  6. If the value of zero flag is not set then goto step 3 otherwise goto next step.
  7. Store the value of CX to memory.
  8. Terminate the program.

Program

MOV     AX, [0600]
MOV     CX, 0000
MOV     BX, FFFF
*** ADD BX, 02
INC     CX
SUB     AX, BX
JNZ ***
MOV     [0602], CX
HLT

Observation

INPUT:
0600:19
0601:00

OUTPUT:
0602:05

Hence, we successfully calculated the square root of a number using 8086 Microprocessor.




Comments and Discussions!

Load comments ↻





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