STOSL指令
来源:互联网 发布:淘宝买东西无法付款 编辑:程序博客网 时间:2024/05/17 07:57
1.AT&T的X86汇编指令;
2.STOSL指令相当于将EAX中的值保存到ES:EDI指向的地址中,若设置了EFLAGS中的方向位置位(即在STOSL指令前使用STD指令)则EDI自减4,否则(使用CLD指令)EDI自增4;
3.在linux0.12内核的head.s文件中,有如下汇编代码:
CLD:
Description
Clears the DF flag in the EFLAGS register. When the DF flag is set to 0, string operations
increment the index registers (ESI and/or EDI). Operation is the same in all
non-64-bit modes and 64-bit mode.
cld;rep;stosl
cld设置edi或同esi为递增方向,rep做(%ecx)次重复操作,stosl表示edi每次增加4,这条语句达到按4字节清空前5*1024*4字节地址空间的目的。
2.STOSL指令相当于将EAX中的值保存到ES:EDI指向的地址中,若设置了EFLAGS中的方向位置位(即在STOSL指令前使用STD指令)则EDI自减4,否则(使用CLD指令)EDI自增4;
3.在linux0.12内核的head.s文件中,有如下汇编代码:
.align 2setup_paging:movl $1024*5,%ecx/* 5 pages - pg_dir+4 page tables */xorl %eax,%eaxxorl %edi,%edi/* pg_dir is at 0x000 */ cld;rep;stosl /* <--------笔者提到了这里 */movl $pg0+7,_pg_dir/* set present bit/user r/w */movl $pg1+7,_pg_dir+4/* --------- " " --------- */movl $pg2+7,_pg_dir+8/* --------- " " --------- */movl $pg3+7,_pg_dir+12/* --------- " " --------- */movl $pg3+4092,%edimovl $0xfff007,%eax/* 16Mb - 4096 + 7 (r/w user,p) */std1:stosl/* fill pages backwards - more efficient :-) */subl $0x1000,%eaxjge 1bxorl %eax,%eax/* pg_dir is at 0x0000 */movl %eax,%cr3/* cr3 - page directory start */movl %cr0,%eaxorl $0x80000000,%eaxmovl %eax,%cr0/* set paging (PG) bit */ret/* this also flushes prefetch-queue */</span>其中在Intel官方文档《Volume 2A Instruction Set Reference (A-M)》中提到cld指令
CLD:
Description
Clears the DF flag in the EFLAGS register. When the DF flag is set to 0, string operations
increment the index registers (ESI and/or EDI). Operation is the same in all
non-64-bit modes and 64-bit mode.
cld;rep;stosl
cld设置edi或同esi为递增方向,rep做(%ecx)次重复操作,stosl表示edi每次增加4,这条语句达到按4字节清空前5*1024*4字节地址空间的目的。
0 0
- STOSL指令
- 汇编LODSB/LODSW指令、STOSL指令
- 指令
- “%@ %”指令
- #指令
- 指令
- 指令
- 指令
- 指令
- 指令
- 指令
- 指令
- 指令
- 指令
- 指令
- @Import指令:导入指令
- vi指令 vim指令
- arm指令移位指令
- Volley完全解析3 定制自己的Request
- C++构造函数详解及显式调用构造函数
- bat有规律的连续启动n个exe
- The method ** must override a superclass method解决方法
- JAVA 堆栈 堆 方法区 静态区 final static 内存分配 详解
- STOSL指令
- CList
- dom4j使用
- 转移iOS App常见问题和回答
- Meta标签详解
- Resin服务器配置指南
- WPF学习 第十一章1 样式
- 关于signal, kill, mutex, spinlock的一些总结
- 优化MySQL性能的几种方法-总结