Write an 8051 Assembly Language Program for Finding Square Root of 8 Bit Number Having Integer...
-
Upload
dineshvhaval -
Category
Documents
-
view
2.048 -
download
49
description
Transcript of Write an 8051 Assembly Language Program for Finding Square Root of 8 Bit Number Having Integer...
![Page 1: Write an 8051 Assembly Language Program for Finding Square Root of 8 Bit Number Having Integer Square Root](https://reader035.fdocuments.net/reader035/viewer/2022071711/55cf991a550346d0339b95a3/html5/thumbnails/1.jpg)
O C T 2 1 , 2 0 0 8
Assembly language program to find square root of 8-bit numberFollowing 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,2000MOV DI,4000MOV CX,0001MOV BX,0000MOV AL,[SI] ; Load AL with the value given as at SIUP SUB AL,CLJL down ; jump to down labelINC BLADD CL,02 ; add 2 to contents of CL registerJMP UP ; jump to up labelDOWN MOV[DI],BLINT A5
Thus by implementing the above code we can find the square root of 8-bit number