Why is the program collapsing?

Viewed 31

The Error Is: -Integer divide by 0

i checked on the debugger and its working i dont understand what is going on Value is never zero so how i divide by 0?

the code:

        IDEAL

    MODEL large
P386

STACK 256

DATASEG

    Speed            DB 1
    Value            DW 1

CODESEG   

 Start:

    mov ax, @data
    mov ds, ax

@@NoValue:
    inc [Value]
    mov ax,8
    div [Value]
    cmp dx,8
    jne @@NoValue
    inc [Speed]


Exit:   
    mov ax,04c00h
    int 21h
End Start
0 Answers
Related