[转]汇编中的movl,movw,movb的作用

标签:
mov |
分类: Linux |
操作系统:ubuntu11.10
MOV指令的基本格式:
注意:GNU汇编器使用 AT&T 样式的语法,所以其中的源和目的操作数和 Intel 文档中给出的顺序是相反的。
MOV指令的源和目的操作数组合如下:
实例:
-
.section
.data
-
output:
-
.asciz "The value is %d\n"
-
values:
-
.int 10
-
.section
.text
- .global _start
- _start:
-
nop
-
movl $0,%edi
- loop:
-
movl values(,%edi,4),%eax
-
pushl %eax
-
pushl $output -
call printf
-
addl $8,%esp
-
inc % -
cmpl $11,%edi
-
jne
-
movl $0, %
-
movl $1, %
-
int $0x80 - 结果:
-
http://s1/mw690/0024GkFIzy72VKBc5uU00&690
http://s6/mw690/0024GkFIzy72VKBJtxbe5&690
- 转自:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=28458801&id=3558498
-