.size X,.-X 之类的代码模式有什么作用? [英] What does code pattern like .size X,.-X do?

查看:15
本文介绍了.size X,.-X 之类的代码模式有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于我在 ARM CORTEX M 启动文件中找到的一些流行但没有详细记录的代码,例如 这个STM32.

My question is about some popular but not well documented code I have found in ARM CORTEX M startup files like this STM32.

模式"是:

.size X,.-X

,其中 X 是符号或标签.

,where X is a symbol or label.

我找到了这个答案并了解.size指令和 dot 特殊符号 工作,但仍然完整的行似乎对我没有任何作用..-X 操作的结果不会存储在任何地方.

I have found this answer and understand how .size directive and dot special symbol work, but still complete line seems to do nothing to me. The result of the operation .-X isn't stored anywhere.

谁能解释一下这条线的作用?

Could anybody explain what the line does?

推荐答案

即放在函数X的末尾,函数的大小就是函数末尾和开头的差.. 是当前位置,所以它说 .size x 是此处与标签 x.

That is placed at the end of function X, and the size of the function is the difference between the end of the function and the beginning. . is the current location so it's saying .size x is the difference between here and the label x.

这篇关于.size X,.-X 之类的代码模式有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆