当前位置:网站首页>GNU pseudo instruction definition function
GNU pseudo instruction definition function
2022-07-23 07:25:00 【hhcs】
Define a function in the assembly ,type,func Fine , Generally, you can use global Set global properties , For external use c Code to call

The first one is , Using pseudo instructions
.func xx
MRS X0, SCTLR
RET
endfunc
atf Example

among func ,endfunc Is a macro

The second kind , Use type
type Used to set the type of symbol , set the type of a symbol.
The official introduction :

Format :
.type fun_name, @function //@function It can be %function
fun_name:
#content
ret
.type Instruction assignment fun_name Address when calling this function for other assemblers .
fun_name Also function name .
@function Indicates that the function content starts .
ret The instruction indicates the end of the function , Return to the place where the parent function calls the child function .
global Usage method ,
.global symbol, .globl symbol
.global makes the symbol visible to ld. If you define symbol in your partial program,
its value is made available to other partial programs that are linked with it. Otherwise,
symbol takes its attributes from a symbol of the same name from another file linked into
the same program.
Both spellings (‘.globl’ and ‘.global’) are accepted, for compatibility with other assemblers.
.global <symbol> This directive gives the symbol external linkage (similar to EXPORT in armasm).
Example
.global func1
.type func1 %function
func1:
MRS X0,ICC_XX
ret
The third kind of , Use macro Macro definition defines functions and parameters
.macro <name> {<arg_1} //name must , The following parameters are optional
{,<arg_2>} ... {,<arg_N>} Just look at this example
.macro SHIFTLEFT a, b
.if \b < 0
MOV \a, \a, ASR #-\b
.exitm
.endif
MOV \a, \a, LSL #\b
.endm
Macros can be nested , Another macro can be called in the macro
atf Example

边栏推荐
- NULL与nullptr
- 接口-Fiddler-简介与安装
- 小黑leetcode之旅:100 相同的树
- Unable to open the proxy server. What should I do if the proxy server is not set to full access?
- DataGrip使用教程(GIF版)
- 常见的跨域问题
- redis的持久化
- ESP32教程(一):VScode+platformIO和Vscode+ESP-IDF两种开发环境搭建
- 一根网线怎么连接两台电脑传文件 一根网线连接两台电脑的方法
- postman “status“: 500, “error“: “Internal Server Error“, “message“: “The request was rejecte“
猜你喜欢

Kotlin learning quick start (8) - Delegation

Q6ui布局操作

什么是真正的 HTAP ?(二)挑战篇

Flink data source disassembly and analysis (Wikipedia editssource)

C语言 文件操作(含所有知识点,相关函数及代码详解)

ESP32:Arduino教程汇总

小黑leetcode之旅:590. N 叉树的后序遍历

ESP32教程(一):VScode+platformIO和Vscode+ESP-IDF两种开发环境搭建

Countermeasure and defense method based on softmax activation transformation

浅析缓存的读写策略
随机推荐
Countermeasure and defense method based on softmax activation transformation
网络空间拟态防御发展综述:从拟态概念到“拟态+”生态
IP第二次实验 MGRE OSPF
基于证据理论物联网安全态势感知方法研究
小黑leetcode之旅:100 相同的树
NFTScan 与 Atem Network 在 NFT 数据领域达成战略合作
怎样删除c盘非系统文件 c盘爆红了可以删除的文件汇总
【学习笔记之菜Dog学C】大厂笔试,就这?
[C# 数组]-C# 之中的一维数组和对象数组
基于softmax激活变换的对抗防御方法
标签平滑(label smoothing)
Flink data source disassembly and analysis (Wikipedia editssource)
DataGrip使用教程(GIF版)
AE常用表达式汇总「建议收藏」
接口-Fiddler-简介与安装
Livegbs design document of security camera internet live broadcast scheme
LUR caching algorithm
How to open the tutorial of administrator permission setting for computer administrator permission
银行虚拟人技术应用领域及作用介绍
电脑如何快速关机 电脑关机命令分享