TSQRT:
CLR A
MOV R0,A
MOV R6,A
MOV R7,A
MOV R1,#06H
MOV R2,80H
MOV R3,00H
LOOP:
CLR C
MOV R4,#01H
MOV R5,#00H
LOOP1:
MOV A,R4
ADD A,R4
DA A
MOV R6,A
MOV A,R5
ADDC A,R5
DA A
MOV R7,A
CLR C
MOV A,#9AH
SUBB A,#01H
ADD A,R6
DA A
CPL C
MOV R6,A
MOV A,#9AH
SUBB A,#00H
ADD A,R7
DA A
CPL C
MOV R7,A
JNC C,LOOP2
INC R0
CLR A
ADD A,R6
DA A
MOV R0,A
LOOP2:
CLR C
MOV A,#9AH
SUBB A,R6
ADD A,R3
DA A
CPL C
MOV R3,A
MOV A,#9AH
SUBB A,R7
ADD A,R2
DA A
CPL C
MOV R2,A
MOV A,#9AH
SUBB A,R0
ADD ,R1
DA A
CPL C
MOV R1,A
JC C,LOOP3
CLR C
MOV A,R4
ADD A,#01H
DA A
MOV R4,A
MOV A,R5
ADDC A,#00H
DA A
MOV R5,A
SJMP LOOP1
LOOP3:
CLR C
MOV A,#9AH
MOV A,#01H
ADD A,R4
DA A
CPL C
MOV R4,A
MOV A,#9AH
SUBB A,#00H
ADD A,R5
DA A
CPL C
MOV R6,A
RET