Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID


We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

finding circle area help

hi, i have to write code which lets you to input radius and then finds area of the circle. the rasult musn't be only integer so i use quadruple real number variables. then i dont know how to move such variable to microprocessor because all registers are no more than 16bit. Thats my code, please help me to finish it (var3 is 3,14)
ASSUME CS:code, DS:data, SS:sstack

DB 256 dup (?)
sstekas ENDS


msg db 10, 13, "Input radius"
enterp db 10, 13, "$"
maxlength db 255
length db ?
var1 dq 8 dup ('0')
var2 dq ?
var3 dq 19023D70A3D70A3Dh
res_str db 19 dup ('$')
res dd 00000000h

data ENDS


mov ax, data
mov ds, ax

mov ax, 02h
int 10h

mov dx, offset msg
mov ah, 9
int 21h

mov dx, offset maxlength
mov ah, 10
int 21h

mov dx, offset enterp
mov ah, 9
int 21h

fld var3
fld var2
fld var1
fst st(1)
fmul st(0), st(1)
fmul st(0), st(2)
fst res

call res_to_str
call print_res

mov ah, 07h
int 21h

mov ah, 4Ch
int 21h


push ax
push di
push cx
push dx

xor di, di
xor cx, cx
mov dx, 10
mov ax, res

div dl
xor ah, ah
inc cx
cmp al, 0
je res_buf
jmp find_length

mov ax, res
mov di, cx
dec di

div dl
mov res_str[di], ah
dec di
loop mov_to_buf

pop dx
pop cx
pop di
pop ax


push ax
push dx

mov dx, offset res_str
mov ah, 9
int 21h

pop dx
pop ax


code ends
end start
Sign In or Register to comment.