实验12 编写0号中断的处理程序
生活随笔
收集整理的這篇文章主要介紹了
实验12 编写0号中断的处理程序
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1,在地址0:200h處安裝中斷代碼,安裝程序如下:
assume cs:codesgcodesg segment start: mov ax, csmov ds, axmov si, offset do0 ;設置ds:si指向源地址mov ax, 0mov es, ax mov di, 200h ;設置es:si指目的地址mov cx, offset do0end - offset do0 ;設置cx傳輸長度cldrep movsbmov ax, 0 ;設置中斷向量表mov es, axmov word ptr es:[0*4], 200hmov word ptr es:[0*4+2], 0mov ax, 4c00hint 21h;do------------------------ do0: jmp short do0startdb "divide error!" do0start:mov ax, csmov ds, axmov si, 202h ;設置指向字符串mov ax, 0b800hmov es, axmov di, 12*160+36*2mov cx, 13mov bh, 2 s: mov bl, ds:[si]mov es:[di], bl mov es:[di+1], bhinc siadd di, 2loop smov ax, 4c00hint 21h do0end: nopcodesg ends end start2,int 0中斷應用程序 assume cs:codecode segment start:int 0mov ax, 4c00hint 21hcode ends end start
3,先執行第一個程序,完成中斷程序安裝,然后運行第二個除法溢出應用程序,程序運行結果如下:
4,實驗體會
邊實踐邊思考邊總結,三者缺一不可,首先不是想明白了再去做,那樣的話永遠也想不明白!其次,實踐了,思考了,但是沒有總結出結果,下一次還要從頭做起,保存好當前思考的環境,以備下次快速切換回來進行更深入的思考,這樣才更有效率。
總結
以上是生活随笔為你收集整理的实验12 编写0号中断的处理程序的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一款 redis客户端工具RedisDe
- 下一篇: python统计英文句子每个单词字数_P