0
name l2z1
data segment
    br4 dw 0FFFEh
    br5 db 0FFh
data ends
code segment
    assume cs:code, ds:data
ut:
    mov ax,data
    mov ds, ax
    
    mov ax, br4
    mov bh, 0
    mov bl, br5
    div bl
    
    mov bx,0
    mov bh,ah
    mov bl, al
    
    
    mov ax, 4ch
    int 21h
    
code ends
end ut

This code works correctly for small numbers, but when I try to divide 0FFFFh by 0FFh program just terminates unexpectedly. Can someone tell me why and how to solve this problem?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

0 Answers0