COMPILER_ABSTRACTION头文件的关键字

在查看某个项目工程的过程中发现底层存在一个.c后缀的汇编文件,一时感兴趣注意到asm关键字,往下走发现了这个头文件。

#if defined ( __CC_ARM )

    #ifndef __ASM
        #define __ASM               __asm
    #endif

    #ifndef __INLINE
        #define __INLINE            __inline
    #endif

    #ifndef __WEAK
        #define __WEAK              __weak
    #endif

    #ifndef __ALIGN
        #define __ALIGN(n)          __align(n)
    #endif

    #ifndef __PACKED
        #define __PACKED            __packed
    #endif

    #define GET_SP()                __current_sp()

#elif

...

...

#endif

asm,通常用于嵌入汇编代码 https://zhuanlan.zhihu.com/p/455686605

inline是内联,与代码优化等级相关,他是建议而不是强制。https://blog.youkuaiyun.com/huanghui167/article/details/41346663

weak用于解决可能的重定义。https://eureka1024.blog.youkuaiyun.com/article/details/81628417

align用于指定对齐。https://biao2488890051.blog.youkuaiyun.com/article/details/89525819

packed用于压缩字节对齐现象,提高传输速率使用。https://xiaopengzhen.blog.youkuaiyun.com/article/details/90751116

current_sp表示当前的堆栈指针,我们可以在Register视图看到SP。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值