View Single Post
Old Jan 29th, 2006, 4:13 AM   #2
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 297
Rep Power: 4 Klarre is on a distinguished road
I tried to link your program and got the error that there were no entry point in the program. I added two rows, and then it worked. Try this code.
.model small
.stack

.data
lf equ 0ah
cr equ 0dh

prompt1 db cr,lf,"Enter task: ","$"
prompt1a db cr,lf,"[1] Convert centigrade to farenheit","$"
prompt1b db cr,lf,"[2] Convert farenheit to centigrade","$"
prompt2 db cr,lf,"Enter temp: ","$"

.code
start: ; ADDED
main proc far
mov ax,@data
mov ds,ax

call firstprompt

cmp al,'1'
je centigrade
cmp al,'2'
je farenheit
jmp firstprompt

main endp

firstprompt:
mov ax,offset prompt1
call write
mov ax,offset prompt1a
call write
mov ax,offset prompt1b
call read
ret

write:
mov ah,09h
int 21h
ret

read:
mov ah,01h
int 21h
ret

centigrade:
jmp entertemp
sub ax,32d
mov bx,5d
mul bx
mov bx,9d
div bx
call write

farenheit:
jmp entertemp
mov bx,9d
mul bx
mov bx,5d
div bx
mov bx,32d
add ax,bx
call write

entertemp:
mov ax,offset prompt2
call write
call read
ret

endprog:
mov ax,4c00h
int 21h

end start ; MODIFIED

It outputs some crap though, so you got some time with debugging now.
Klarre is online now   Reply With Quote