Professional Documents
Culture Documents
Jkbdiwbfiwn
Jkbdiwbfiwn
Problem Number: 11
Source Code:
.MODEL small
.STACK 100h
.DATA
number DW 16 ; Input number to find square root
result DW ? ; Variable to store the result
.CODE
MAIN PROC
MOV CX, 0FFFFh ; Set the initial value of the iteration counter
MOV BX, AX ; Copy the value of AX to BX
MOV DX, 0 ; Clear DX register
CALCULATION:
ADD BX, AX ; BX = BX + AX
SHR BX, 1 ; BX = BX / 2
MOV AX, BX
MOV DX, 0
MUL AX
DEC CX
JNZ CALCULATION
RESULT:
MOV result, BX
MAIN ENDP
END MAIN
Input:
number DW 25 ; Input number to find square root
OutPut:
result DW 5 ; Square root of 25 is 5