hello friends:
I am a student of Assembly language and making some programs to have an insight of this language.. along with i am also supposed to submit a project at the end.
I've made this program, which'll convert tempt from celsius to fehrenheit and vice versa..It's compiled in masm611 and generating no errors..But its not giving the accurate results..I dnt Why..?
Here the code goes..

.model small
.stack 100h
.data
msg db 0ah, 0dh, 'To convert from Celsius to Fahrenheit, press "f" ' , 0ah, 0dh, 'To convert from Fahrenheit to Celsius, press "c" ', '\$'
msg1 db 0ah, 0dh, 'Temperature in Celcius is: ', 0ah, 0dh, '\$'
msg2 db 0ah, 0dh, 'Temperature in Fahrenheit is: \$'
msg3 db 0ah, 0dh, 'Do you want to do it again: (y/n), \$'
msg4 db 0ah, 0dh, 'Invalid entry! \$'
msg5 db 0ah, 0dh, 'Enter the temp: \$'

tmp db ?
dvs db ?

f db ?
ces db ?
result db ?

.code
.startup

OUTER:
LEA dx, msg
MOV ah, 9
int 21h

MOV ah, 1
int 21h

CMP al, 'f'
JE feh

CMP al, 'c'
JE cel

JMP err

CEL:

lea dx, msg5
mov ah,9
int 21h

CALL indec

MOV f, al

SUB f, 32d	;f= f - 32

MOV dvs, 9
MOV al, 5	;al = dividend
IDIV dvs	;dvs = divisor

MOV cl, al	;cl=5/9

MOV al, f
IMUL cl

LEA dx, msg1
MOV ah, 9
int 21h

xor ah, ah

MOV ah,2
mov dl, 0ah
int 21h
mov dl, 0dh
int 21h

CALL outdec

JMP again

;f = c * 9 / 5 + 32

FEH:
lea dx, msg5
mov ah,9
int 21h

CALL indec

MOV ces, al

MOV dvs, 5
MOV al, 9
IDIV dvs

;MOV tmp, al	;tmp = 9/5

IMUL ces

MOV cx, ax	;cx = c*9/5

MOV ax, cx

MOV ah,2
mov dl, 0ah
int 21h
mov dl, 0dh
int 21h

CALL outdec

JMP again

ERR:

LEA dx, msg4
mov ah, 9
int 21h

AGAIN:
LEA dx, msg3
mov ah, 9
int 21h

MOV ah, 1
int 21h

CMP al, 'y'
JE outer

CMP al, 'Y'
JE outer

JMP end1

END1:
.exit

;Indec proc for decimal input
INDEC PROC
PUSH bx
PUSH cx
PUSH dx
@begin:
XOR bx, bx
XOR cx, cx

MOV ah,1
int 21h

CMP al, '-'
JE @minus

CMP al, '+'
JE @plus
JMP @repeat2

@MINUS:
MOV cx,1

@PLUS:
int 21h

@repeat2:
CMP al, '0'
JNGE @not_digit

CMP al, '9'
JNLE @not_digit

AND ax, 000fh
PUSH ax

MOV ax, 10
MUL bx
POP bx

MOV ah,1
int 21h

CMP al, 0dh
JNE @repeat2

MOV ax, bx

OR cx, cx
JE @exit

NEG ax

@EXIT:
POP dx
POP cx
POP bx
RET

@not_digit:
MOV ah,2
MOV dl, 0dh
int 21h

MOV dl, 0ah
int 21h
JMP @begin

INDEC endp

;decimal output, from Ytha Yu's book on assembly
OUTDEC PROC

PUSH AX
PUSH BX
PUSH CX
PUSH DX

OR AX, AX
JGE @END_IF1

PUSH AX
MOV DL, '-'
MOV AH, 2
INT 21H

POP AX
NEG AX

@END_IF1:
XOR CX, CX
MOV BX, 10D

@REPEAT1:
XOR DX, DX
DIV BX
PUSH DX
INC CX

OR AX, AX
JNE @REPEAT1

MOV AH, 2

@PRINT_LOOP:
POP DX
OR DL, 30H
INT 21H
LOOP @PRINT_LOOP

POP DX
POP CX
POP BX
POP AX

RET

OUTDEC ENDP

end