hi . . .
This code is a procedure for a timer to be displayed on a game I'm programing using assembly
but when I assemble it it gave Divide overflow
CODE
; variables for timer
det_flag DB 5
time_flag DB ?
time DB 30H ,3ah, 30h, 30h
time_print_c DB 67
time_out DB "TIME OUT ",0
ten DB 10
ur_score DB 30h,30h,30h
;define a procedure to read the time of that game.
mRead_time PROC NEAR
PUSHA
setCrusor 22,69
MOV AH,2Ch
INT 21h
MOV AL,DH
DIV ten
MOV CH,AH
ADD CH,30h
CMP [time_flag],CH
JE no_time_inc
inc_now:
MOV [time_flag],CH
CMP [time+3],39h
JE inc_sec
INC [time+3]
JMP print_time
inc_sec:
MOV [time+3],30h
CMP [time+2],35h
JE inc_min
INC [time+2]
JMP print_time
inc_min:
MOV [time+2],30h
INC [time]
print_time:
MOV DL,[time+SI]
MOV AH,06h
INT 21h
INC SI
CMP SI,4
JE no_time_inc
JMP print_time
no_time:
setCrusor 22,67
MOV DX, OFFSET time_out
MOV CX,9
MOV BX,0
MOV AH,40h
INT 21h
final_exit:
MOV DL,0FFh
MOV AH,06h
INT 21h
JZ final_exit
CMP AL,1bh
JE final_exit0
JMP final_exit
final_exit0:
MOV AH,4Ch
INT 21h
no_time_inc:
POPA
RET
mRead_time ENDP
Please can any one help me why ?
thank you
This post has been edited by born2c0de: 27 Dec, 2007 - 10:36 PM