I am trying to do a calculation in emu8086, however there doesn't seem to be a root function available, I have been trying to make it myself, and I think I got it, however i'm getting errors on two lines:
;si is the number that I need the square root of.
mov bx, 0 ;sets the cycle to start at 0
mov dx, si ;moves the number into dx for processing
sqrt: ;the loop, it continues as long as bx < si/2
mov ax, si ;from here starts this formula: x = (x + n / x) / 2
div dx ;I am getting a divide error -overflow here
add ax, dx
mov ch, 2
div ch ;the same divide error -overflow here
mov dx, ax
mov ax, si
mov ch, 2
div ch
cmp bx, ax ;the formula repeats until bx = si/2
jl sqrt
cmp bx, ax ; if bx = si/2, exit the loop.
jge cnt:
;sqrt si
cnt:
mov si, dx
why are the two errors showing up?