can you explain me how to write an assembly program in 8085 to find square root of a number

# square root of a number

0

What algorithm are you using, and are you using floating point or integer arithmetic?

nithyasj
like this

0

0

Before you can write a program you need to know how to do what your program will do. You can't just say to the computer "do a square root" cos it won't know what that means. So you need to start with an algorithm for working out square roots (and I don't mean "enter the number then press the square root key"). Once you know how to work out square roots you can then start learning assembly and in the process of that, see what instructions you will need to implement that algorithm,

One way to work out the square root of X is to start with N=1 and see if N*N is less than or equal to X. If it is then increment it and repeat. When N*N is greater than X you know you've gone past it, so decrement N and that is the closest integer to the true square root of X. This is a fairly easy program do to in any language, but of course you need to know how to write programs, which you should already know how to do if you're on a programming course and your teacher has just said "Right, now write a program to do square roots".