8086汇编0号中断处理程序

Posted on 2018-03-22 16:40  #大囚长#  阅读(328)  评论(0编辑  收藏  举报

**本篇代码为王爽《汇编语言》实验12正确答案,部分冗余未作处理。
——————————-**

这里写图片描述

assume cs:code
    code segment

    start: mov ax,cs
           mov ds,ax
           mov si,offset do0
           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*4],200h
           mov word ptr es:[0*4+2],0

           mov ax,1000h
           mov bh,1
           div bh

           mov ax,4c00h
           int 21h
    do0:   jmp short do0 start
              db "divide error!"

    do0start: mov ax,cs
              mov ds,ax
              mov si,202h

              mov ax,0b800h
              mov es,ax
              mov di,12*160+36*2

              mov cx,13

           s: mov al,[si]
              mov es:[di],al
              inc si
              add di,2
              loop s

              mov ax,4c00h
              int 21h

    do0end:nop
    code ends
    end start