assume cs:codesg
codesg segment
start:
;mofify interrupt table
mov ax,0
mov es,ax
mov di,ax
mov es:[di],200H
mov word ptr es:[di+2],0
;copy interrupt proc
mov ax,cs
mov ds,ax
mov si,offset interrup0
mov di,200H
mov cx,offset interrup0end - offset interrup0
;start copy
cld
rep movsb
mov ax,4c00h
int 21h
;interrupt 0 process
interrup0:
jmp short realstart
db "divide error!"
realstart:
;src data address
mov ax,0
mov es,ax
mov di,202H
;dest data address
mov ax,0b800H
mov ds,ax
mov si,(160*12+34*2)
;start copy
mov cx,13
startcopy:
mov al,es:[di]
mov ds:[si],al
mov ax,0a0H
mov ds:[si+1],ax
inc di
add si,2
loop startcopy
mov ax,4c00h
int 21h
interrup0end:
nop
codesg ends
end start
codesg segment
start:
;mofify interrupt table
mov ax,0
mov es,ax
mov di,ax
mov es:[di],200H
mov word ptr es:[di+2],0
;copy interrupt proc
mov ax,cs
mov ds,ax
mov si,offset interrup0
mov di,200H
mov cx,offset interrup0end - offset interrup0
;start copy
cld
rep movsb
mov ax,4c00h
int 21h
;interrupt 0 process
interrup0:
jmp short realstart
db "divide error!"
realstart:
;src data address
mov ax,0
mov es,ax
mov di,202H
;dest data address
mov ax,0b800H
mov ds,ax
mov si,(160*12+34*2)
;start copy
mov cx,13
startcopy:
mov al,es:[di]
mov ds:[si],al
mov ax,0a0H
mov ds:[si+1],ax
inc di
add si,2
loop startcopy
mov ax,4c00h
int 21h
interrup0end:
nop
codesg ends
end start