100% found this document useful (1 vote)
10K views

Write An 8051 Assembly Language Program For Finding Square Root of 8 Bit Number Having Integer Square Root

This assembly language program finds the square root of an 8-bit number by loading the number into the SI register, initializing index registers with values, and using JMP instructions and logical steps like subtraction and incrementing to iteratively calculate the square root value, which is stored in the BL register and placed in the DI memory location at the end.

Uploaded by

dineshvhaval
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
10K views

Write An 8051 Assembly Language Program For Finding Square Root of 8 Bit Number Having Integer Square Root

This assembly language program finds the square root of an 8-bit number by loading the number into the SI register, initializing index registers with values, and using JMP instructions and logical steps like subtraction and incrementing to iteratively calculate the square root value, which is stored in the BL register and placed in the DI memory location at the end.

Uploaded by

dineshvhaval
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like