assume cs:code
code segment
start:
mov ax, cs
mov ds, ax
mov ax, offset do0
mov si, ax
mov ax, 0
mov es, ax
mov di, 200h
mov cx, offset do0end - offset do0
cld
rep movsb
mov ax, 0
mov es, ax
mov word ptr es:[0], 200h
mov word ptr es:[2], 0
mov ax, 100
mov bx, 0
div bx
mov ax, 4c00h
int 21h
do0:
jmp short do0_code
db "Divide error:Overflow!",0
do0_code:
push ax
push ds
push si
push dx
push cx
mov ax, 0b800h
mov es, ax
mov ax, 0
mov cx, 160*25
clearscreen:
mov word ptr es:[bx],ax
inc bx
loop clearscreen
mov ax, cs
mov ds, ax
mov si, 0202h
mov di, 12*160+30*2
s:
mov al, [si]
cmp al,0
jz send
mov es:[di],al
mov byte ptr es:[di+1],10000100b
inc si
add di,2
jmp short s
send:
pop cx
pop dx
pop si
pop ds
pop ax
mov ax, 4c00h
int 21h
do0end:
nop
code ends
end start