当前位置: 首页 > news >正文

朝阳网站建设公司/最近一周的新闻

朝阳网站建设公司,最近一周的新闻,网站后台发布图片upload failed,wordpress免授权08影院源码8086汇编学习小记-王爽汇编语言第十五章外中断及实验15 外中断是指那些不再CPU内部产生的中断,即通过端口与cpu通信的外设产生的中断。 可屏蔽中断是CPU可以不响应的外中断不可屏蔽中断是CPU必须响应的中断,其中断类型码都是2sti,cli可以屏蔽…
8086汇编学习小记-王爽汇编语言第十五章外中断及实验15

外中断是指那些不再CPU内部产生的中断,即通过端口与cpu通信的外设产生的中断。

  1. 可屏蔽中断是CPU可以不响应的外中断
  2. 不可屏蔽中断是CPU必须响应的中断,其中断类型码都是2
  3. sti,cli可以屏蔽中断,让一些如改变中断向量的操作安全进行。

(1)下面程序在屏幕中某个位置一次输出A~Z,按ESC改变该位置颜色:

 1 ;中断时的入栈顺序是pushf,push cs, push ip
 2 assume cs : codesg, ss : stacksg
 3 
 4 stacksg SEGMENT
 5      dw 64 dup (0)
 6 stacksg ENDS
 7 
 8 
 9 
10 codesg SEGMENT
11 
12 start:    ;改变中断向量到本程序中的中断例程处
13     mov ax, 0
14     mov es, ax
15     mov ax, stacksg
16     mov ss, ax
17     mov sp, 64
18     mov ds, ax
19     
20     ;分别将中断程序cs:ip入栈ds:[si]分别存ip,cs
21     push es : [9 * 4 + 2]
22     push es : [9 * 4]
23     mov si, sp
24     
25     ;改变中断向量
26     cli
27     mov ax, codesg
28     mov es : [9 * 4 + 2], ax
29     mov word ptr es : [9 * 4], offset int9
30     sti
31     
32     mov ax, 0b800h
33     mov es, ax
34     mov bl, 'A'
35 print:    mov es : [12 * 160 + 36 * 2], bl
36     add bl, 1
37     call delay
38     cmp bl, 'Z'
39     jna print
40     
41     ;改回中断向量
42     mov ax, 0
43     mov es, ax
44     cli
45     mov ax, word ptr ds : [si + 2]
46     mov es : [9 * 4 + 2], ax
47     mov ax, word ptr ds : [si]
48     mov es : [9 * 4], ax
49     sti
50 
51     mov ax, 4c00h
52     int 21h
53 
54 
55 delay:    push ax
56     push bx
57     mov ax, 0
58     mov bx, 1000h
59 wl:    sub ax, 1
60     sbb bx, 0
61     cmp ax, 0
62     jne wl
63     cmp bx, 0
64     jne wl
65     pop bx
66     pop ax
67     ret
68 
69 ;原来的中断例程存放在ds:[si]处
70 int9:        push ax
71         push es
72         pushf ;中断例程最后是iret
73                 ;注意是dword
74         call dword ptr ds : [si] ;运行原中断例程处理硬件细节
75 
76         in al, 60h
77         cmp al, 1
78         jne int9end
79 
80         mov ax, 0b800h
81         mov es, ax
82         add byte ptr es : [12 * 160 + 36 * 2 + 1], 1
83 
84 int9end:    pop es
85         pop ax
86         iret
87 codesg ENDS
88 END start
89     

在windows XP下运行有效果不过会导致鼠标左键失灵。

(2)安装新的int 9中断历程,按f1改变屏幕显示颜色:

 1 ;cs总在高地址处
 2 assume cs : codesg, ss : stacksg
 3 
 4 stacksg SEGMENT
 5      dw 64 dup (0)
 6 stacksg ENDS
 7 
 8 
 9 
10 codesg SEGMENT
11 
12 start:    mov ax, stacksg
13     mov ss, ax
14     mov sp, 128
15     mov ax, 0
16     mov es, ax
17     mov ax, codesg
18     mov ds, ax
19     mov si, offset int9s
20     mov di, 0200h
21     
22     cli
23     mov bx, offset table
24     mov ax, es : [9 * 4]
25     mov [bx], ax
26     mov ax, es : [9 * 4 + 2]
27     mov [bx + 2], ax
28     mov word ptr es : [9 * 4], 0200h
29     mov word ptr es : [9 * 4 + 2], 0
30     sti
31 
32     mov cx, offset int9end - offset int9s
33     cld
34     rep movsb
35 
36     mov ax, 4c00h
37     int 21h
38 
39 int9s:        jmp short sss
40         table dw 0, 0
41     sss:    push ds
42         push ax
43         push cx
44         push si
45         pushf
46         mov ax, 0
47         mov ds, ax
48         call dword ptr ds : [202h]
49         in al, 60h
50         cmp al, 3bh
51         jne int9ret
52         mov si, 0
53         mov cx, 2000
54         mov ax, 0b800h
55         mov ds, ax
56     s1:    inc byte ptr [si + 1]
57         add si, 2
58         loop s1
59 int9ret:    pop si
60         pop cx
61         pop ax
62         pop ds
63         iret
64 
65 int9end:    nop
66 codesg ENDS
67 END start

效果不错~

(3)安装新的int9中断例程,在DOS下,按下'A'键后,松开就显示满屏幕‘A’,其他照旧:

 1 ;中断时的入栈顺序是pushf,push cs, push ip
 2 assume cs : codesg, ss : stacksg
 3 
 4 stacksg SEGMENT
 5      dw 64 dup (0)
 6 stacksg ENDS
 7 
 8 
 9 
10 codesg SEGMENT
11 
12 start:    mov ax, stacksg
13     mov ss, ax
14     mov sp, 128
15     mov ax, 0
16     mov es, ax
17     mov di, 0200h
18     mov si, offset int9
19     push cs
20     pop ds
21     
22     cli
23     mov bx, offset table
24     mov ax, es : [9 * 4]
25     mov ds : [bx], ax
26     mov ax, es : [9 * 4 + 2]
27     mov ds : [bx + 2], ax
28     sti
29     
30     mov cx, offset int9end - offset int9
31     cld
32     rep movsb
33 
34     mov word ptr es : [9 * 4 + 2], 0
35     mov word ptr es : [9 * 4], 0200h
36     
37     mov ax, 4c00h
38     int 21h
39 
40 int9:    jmp short s
41     table dw 0, 0
42 s:    push ax
43     push cx
44     push si
45     push es
46     mov ax, 0
47     mov ds, ax
48     pushf
49     call dword ptr ds : [202h]
50     in al, 60h
51     cmp al, 9eh
52     jne int9ret
53     mov ax, 0b800h
54     mov es, ax
55     mov si, 0
56     mov cx, 2000
57 s1:    mov byte ptr es : [si], 'A'
58     add si, 2
59     loop s1
60 
61 int9ret:pop es
62     pop si
63     pop cx
64     pop ax
65     iret
66 
67 int9end:nop
68 codesg ENDS
69 END start

因为一个ds寄存器忘记保护现场,导致莫名其妙的错误,谨慎~

posted on 2012-11-11 22:16 左岸阳光 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/ACystalMoon/archive/2012/11/11/2765523.html

http://www.lbrq.cn/news/1284409.html

相关文章:

  • 移动门网站建设/seo查询官方网站
  • 做网站必须托管服务器吗/百度快速排名系统查询
  • 小米路由3g wordpress/淮北seo
  • 网站建设开发软件/地推扫码平台
  • b站24小时直播间十大软件/怎么把产品推广到各大平台
  • 市网站制作/百度网站推广费用
  • 威海专业做网站设计的公司/seo是什么的简称
  • 怎么增加网站关键词库/传统营销与网络营销的区别
  • 重庆网站建设沛宣网络/百度公司官网招聘
  • 工作室怎么网站备案/贵阳网络推广排名
  • 网站用户注册怎么做/市场营销比较好写的论文题目
  • 北京燕化工程建设有限公司网站/引擎优化seo是什么
  • 企业网站的建立/抖音推广渠道有哪些
  • 电子商务网站网络安全设计方案/网络营销中心
  • 网站代运营做哪些/百度关键词优化曝光行者seo
  • 网站工作室模板/企业文化
  • paypal可做网站/网络推广法
  • 公司网站制作高端/时事政治2023最新热点事件
  • 网站开发违约属于什么纠纷/西安网站建设公司排行榜
  • 凡科网站网站建设进不去/seo信息查询
  • wordpress源码之家/seo信息网
  • 服务行业做网站/ 今日头条
  • 大家做网站都会去哪找素材/产品推广方式
  • 招商网站怎么做/优质的seo快速排名优化
  • 做网站开发的想接私活/微信怎么推广引流客户
  • 网站域名备案更改吗/百度爱采购官网
  • 常见的电子商务网站有哪些/技能培训
  • 更换域名对网站的影响/优化关键词排名软件
  • 济南建站软件/阳泉seo
  • 张店低价网站建设/百度指数1000搜索量有多少
  • 云计算技术之docker build构建错误
  • 学习日志19 python
  • Java 大视界 -- Java 大数据在智能安防视频监控系统中的视频语义理解与智能检索进阶(365)
  • 面试150 IPO
  • 记录和分享抓取的数字货币和大A时序数据
  • 去中心化时代的通信革命:briefing与cpolar技术融合带来的安全范式革新