| Tipotas688 2007-12-06, 8:23 am |
| Hello I have a problem with this converter I made.
cr equ 13;
lf equ 10;
JMP START
entertemp:DB 'Please enter the temperature to convert --->',cr,lf,' $'
entertype: DB 'Please enter type of convertion to Celcius(C) or to Fahrenheit(F) $'
temperature DB ?
START:
LEA DX,entertemp
MOV ah,9
INT 21h
MOV AH,1
INT 21h
SUB Al,30H
MOV temperature,Al
LEA DX,entertype
MOV ah,9
INT 21h
MOV AH,1
INT 21h
CMP al,'C'
JE Celc
JNE Fahr
Celc: MOV al,temperature
Mov cx,9
MUL cx
mov cx,5
DIV cx
MOV AH,02H
INT 21H
ADD al,32
JMP START
Fahr: MOV al,-32
mov cx,5
MUL cx
ADD al,temperature
mov cx,9
DIV cx
MOV AH,02H
INT 21H
next: MOV AH,9
INT 21H
MOV AH,4Ch
INT 21h
It doesnt print out the result of the convertion. I think its because I only put one character as the number to be converted but I dont know how to do it in any other way... Also there is a problem with the JNE case... Instead of showing the result if "F" is pressed the program terminates...
Thanks in advance:) |