关闭

ARM汇编:printf

886人阅读 评论(0) 收藏 举报
分类:
#include <stdio.h>
int add3(int a, int b, int c)
{
	return a+b+c;
}
int main()
{
	//char* p="Hello world!";
	int a=1, b=2, c =3;
	printf("func printf: %d\n", a++);
	add3(a, b, c);
	return 0;
}


lumy1@xmws48:~/workspace/mickey/android/external/asmtest$ ~/workspace/mt6592_dev/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-objdump -D -s asmtest.o > asmtest2.asm

Contents of section .rodata.str1.4:
 0000 66756e63 20707269 6e74663a 2025640a  func printf: %d.
 0010 00000000       

Disassembly of section .text.add3:


00000000 <add3>:
   0: 1840      adds r0, r0, r1
   2: 1880      adds r0, r0, r2
   4: 4770      bx lr
   6: bf00      nop

Disassembly of section .text.startup.main:


00000000 <main>:
   0: 4803      ldr r0, [pc, #12]; (10 <main+0x10>)
   2: 2101      movs r1, #1
   4: b508      push {r3, lr}
   6: 4478      add r0, pc
   8:f7ff fffe bl0 <printf>
   c: 2000      movs r0, #0
   e: bd08      pop {r3, pc}
  10: 00000006 andeq r0, r0, r6


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:436302次
    • 积分:5290
    • 等级:
    • 排名:第5134名
    • 原创:32篇
    • 转载:399篇
    • 译文:4篇
    • 评论:22条
    文章分类
    最新评论