1 assume cs:code
2
3 code segment
4 start:
5 mov ax,code
6 mov ds,ax
7 mov si,offset do0
8 mov ax,0
9 mov es,ax
10 mov di,200h
11 mov cx,offset do0end-offset do0
12 cld
13 rep movsb
14
15 mov ax,0
16 mov ds,ax
17 mov word ptr ds:[0],200h
18 mov word ptr ds:[2],0
19
20 mov ax,4c00h
21 int 21h
22
23 do0:
24 jmp short do0start
25 do0str:
26 dw 1
27 db 'divide error! '
28 do0start:
29 mov ax,cs
30 mov ds,ax
31 mov si,202h
32
33 mov ax,0b800h
34 mov es,ax
35 mov di,7c8h
36 mov cx,14
37 ; mov cx,ds:[202h]
38 s:
39 mov al,ds:[si+2]
40 mov es:[di],al
41 inc si
42 add di,2
43 loop s
44
45 mov ax,4c00h
46 int 21h
47
48 mov ax,ds:[202h]
49 inc ax
50 mov ds:[202h],ax
51
52 push cx
53 mov cx,5
54 ds0:
55 push cx
56 mov cx,0ffffh
57 ds1:
58 loop ds1
59 pop cx
60 loop ds0
61 pop cx
62
63 iret
64
65 do0end:
66 nop
67
68 code ends
69 end start