第9章实验8
来源:互联网 发布:tenga flip hole知乎 编辑:程序博客网 时间:2024/05/21 06:57
assume cs:codesg
codesg segment
mov ax,4c00h // ip=0
int 21h
start:
mov ax , 0 // ip=5 ,第一条执行的指令
s: nop // ip=8
nop
mov di, offset s // ip=A
mov si, offset s2
mov ax, cs:[si]
s0: jmp short s
s1: mov ax, 0 // ip=0018H
int 21h
mov ax, 0
s2: jmp short s1 //ip=0020H
nop
codesg ends
codesg segment
mov ax,4c00h // ip=0
int 21h
start:
mov ax , 0 // ip=5 ,第一条执行的指令
s: nop // ip=8
nop
mov di, offset s // ip=A
mov si, offset s2
mov ax, cs:[si]
mov cs:[di], ax //上面这四句将 s2处的指令 “jmp short s1"(2个字节复制到s处),特别注意,"jmp short s1"转化为机器码后跳转参数值是一个
//偏移量,仔细看代码可以知道这个偏移量是-8(ip从0020H跳转到0018H), 所以复制到s处后,s处实际的机器码也是跳-8,而s处的ip=8,
// 跳转后就跳到了 ip=0处,也就是codesg段的第一个字节,执行"mov ax, 4c00h" 和 "int 21h"后,程序结束
s0: jmp short s
s1: mov ax, 0 // ip=0018H
int 21h
mov ax, 0
s2: jmp short s1 //ip=0020H
nop
codesg ends
end start
程序真正执行的过程是:
mov ax , 0
s: nop
nop
mov di, offset s
mov si, offset s2
mov ax, cs:[si]
mov cs:[di], ax
s0: jmp short s //跳转到s处
s://此处现在是2个字节的跳转,跳转到了ip=0的地方
mov ax,4c00h
int 21h
0 0
- 第9章实验8
- 第9次实验
- 第8次实验
- 第9次实验任务
- 第9堂实验任务
- 第9次实验任务
- 第9次实验任务
- 第9次实验任务
- 第8周实验报告
- 第8次实验任务
- 第8次实验任务
- 第8次实验任务
- 第8次实验任务
- 第5章实验4
- C++第4章 实验
- 王爽《汇编语言》第9章 实验8 分析一个奇怪的程序
- 王爽《汇编语言》第9章 实验9 根据材料编程
- tiny6410裸机实验第9章--------------LCD(显示字母)
- 四十九 iptables使用
- 7
- 快速排序
- iOS中旋转图片的代码
- Android开发--LayoutInflater的使用
- 第9章实验8
- 五十 IPtables中SNAT、DNAT和MASQUERADE的含义
- mysql5.5一插入数据就提示ERROR 2013 (HY000): Lost connection to MySQL server during query
- HDU 1421 动态规划
- 配置IKAnalyzer2012扩展词库(tomcat8.0+solr4.6)
- 一致性 hash 算法
- List<T> 根据某个字段排序
- 关于最近的私活--技术篇
- 转载 :Android apk的安装、卸载、更新升级(通过Eclipse实现静默安装)