汇编程序43:实验12 编写0号中断的处理程序
1 assume cs:code 2 //把中断处理程序导入0020:0处,用另一程序测试 3 code segment 4 start: 5 mov ax,cs 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 mov ax,0 15 mov es,ax 16 mov word ptr es:[0*4],200h 17 mov word ptr es:[0*4+2],0 18 mov ax,4c00h 19 int 21h 20 do0: 21 jmp short do0start 22 db 'overflow!' 23 do0start: 24 mov ax,cs 25 mov ds,ax 26 mov si,202h 27 mov ax,0b800h 28 mov es,ax 29 mov di,12*160 + 36*2 30 mov cx,9 31 s: 32 mov al,[si] 33 mov es:[di],al 34 inc si 35 add di,2 36 loop s 37 mov ax,4c00h 38 int 21h 39 do0end: 40 nop 41 code ends 42 43 end start
1 assume cs:code 2 //测试程序,可显示 3 code segment 4 start: 5 mov ax,1000h 6 mov bl,1 7 div bl 8 mov ax,4c00h 9 int 21h 10 code ends 11 12 end start