分类: 汇编 |
http://blog.chinaunix.net/attachment/201304/1/28458801_1364786275ISrv.png
http://blog.chinaunix.net/attachment/201304/1/28458801_1364786337WR8s.png
http://blog.chinaunix.net/attachment/201304/1/28458801_13647864093s8u.png
http://blog.chinaunix.net/attachment/201304/1/28458801_1364786500oooV.png
实例:
点击(此处)折叠或打开
-
.section
.data
-
output:
-
.asciz "The largest value is %d\n" -
-
values:
-
.int 105,234,61,315,134,221,53,145,117,5
-
-
.section
.text
-
.global
_start
-
_start:
-
nop
-
movl values, %ebx
-
movl $1, %edi
-
-
loop:
-
movl values( ,%edi,4), %eax
-
cmp %ebx, %eax
-
cmova %eax, %ebx
-
inc %edi
-
cmp $10, %edi
-
jne loop
-
-
pushl %ebx
-
pushl $output
-
call printf
-
addl $8, %esp
-
pushl $0
-
call exit
结果:
http://blog.chinaunix.net/attachment/201304/1/28458801_1364787423rkkn.png