I want to write a program which converts angles to radians.
format ELF executable 3
entry start
segment readable executable
deg2rad:
mov ax, [val]
mov bx, 180 ; rad = deg*pi/180
mul [pi] ;rad = deg*pi/180
div ebx
start:
mov [rad], ax ; get rad from ax
add [rad],'0' ; to string
mov ax,4 ; output
mov bx,1 ; output
mov cx,[rad] ; output
mov dx,10 ; output
int 0x80 ; output
exit:
mov eax,1
xor ebx,ebx
int 0x80
segment readable writeable
step dw 5
val dw 0.5
pi dw 3.14
rad dw ?
But after compiling and starting program I doesn't display the result. Why? I think error in output. How fix?