4918
5880
3万
GROAD
曲径通幽,安觅芳踪。
loop address
< code before the loop > movl $100, %ecx loop1: < code to loop through > loop loop1 < code after the loop >
使用道具 举报
.section .data output: .asciz "The value is: %d\\n" .section .text .globl _start _start: movl $100, %ecx movl $0, %eax loop1: addl %ecx, %eax loop loop1 pushl %eax pushl $output call printf add $8, %esp movl $1, %eax movl $0, %ebx int $0x80
$ ./loop The value is: 5050
$ ./loop The value is: -2147483648
.section .data output: .asciz "The value is: %d\\n" .section .text .globl _start _start: movl $0, %ecx movl $8, %eax jcxz done loop1: addl %ecx, %eax loop loop1 done: pushl %eax pushl $output call printf movl $1, %eax movl $0, %ebx int $0x80
$ ./loop The value is: 8
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )
GMT+8, 2025-5-3 12:44 , Processed in 0.098641 second(s), 21 queries .
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.