Google

Oct 21, 2008

Assembly language program to find square root of 8-bit number

Following is the assembly language program to find square root of 8-bit number.
In this program we initially load the index registers with specified values. We load the value of the number into SI Register. Then using a few logical steps as mentioned in the code i.e JMP insctructions we find the square root of a 8-bit number.

Code:
MOV SI,2000
MOV DI,4000
MOV CX,0001
MOV BX,0000
MOV AL,[SI] ; Load AL with the value given as at SI
UP SUB AL,CL
JL down ; jump to down label
INC BL
ADD CL,02 ; add 2 to contents of CL register
JMP UP ; jump to up label
DOWN MOV[DI],BL
INT A5

Thus by implementing the above code we can find the square root of 8-bit number

Related posts
square root of hexa decimal number
Ebooks

You might be also interested in:

:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086
:: Assembly Language Source Codes

1 comment:

karthik n said...

very well done!!! can you plzz update this blog with program "how to multiply 2 16 bit numbers"or square of 16 bit numbres?"