- 论坛徽章:
- 0
|
本帖最后由 bxfqing 于 2014-03-20 10:43 编辑
{
int a = 1;
int b = a * 8184;
return b;
}
arm-eabi-gcc 默认编译选项的指令- .arch armv5te
- .fpu softvfp
- .eabi_attribute 20, 1
- .eabi_attribute 21, 1
- .eabi_attribute 23, 3
- .eabi_attribute 24, 1
- .eabi_attribute 25, 1
- .eabi_attribute 26, 1
- .eabi_attribute 30, 6
- .eabi_attribute 18, 4
- .file "asm.c"
- .text
- .align 2
- .global main
- .type main, %function
- main:
- @ args = 0, pretend = 0, frame = 8
- @ frame_needed = 1, uses_anonymous_args = 0
- @ link register save eliminated.
- str fp, [sp, #-4]!
- add fp, sp, #0
- sub sp, sp, #12
- mov r3, #1
- str r3, [fp, #-12]
- ldr r3, [fp, #-12]
- mov r3, r3, asl #3
- mov r2, r3, asl #10
- rsb r3, r3, r2
- str r3, [fp, #-8]
- ldr r3, [fp, #-8]
- mov r0, r3
- add sp, fp, #0
- ldmfd sp!, {fp}
- bx lr
- .size main, .-main
- .ident "GCC: (GNU) 4.4.0"
- .section .note.GNU-stack,"",%progbits
复制代码 arm-eabi-gcc -O2编译选项的指令- .arch armv5te
- .fpu softvfp
- .eabi_attribute 20, 1
- .eabi_attribute 21, 1
- .eabi_attribute 23, 3
- .eabi_attribute 24, 1
- .eabi_attribute 25, 1
- .eabi_attribute 26, 1
- .eabi_attribute 30, 2
- .eabi_attribute 18, 4
- .file "asm.c"
- .text
- .align 2
- .global main
- .type main, %function
- main:
- @ args = 0, pretend = 0, frame = 0
- @ frame_needed = 0, uses_anonymous_args = 0
- @ link register save eliminated.
- ldr r0, .L3
- bx lr
- .L4:
- .align 2
- .L3:
- .word 8184
- .size main, .-main
- .ident "GCC: (GNU) 4.4.0"
- .section .note.GNU-stack,"",%progbits
复制代码 |
|