组装 - 获取外部标签地址
外部标签(指代码或数据无关紧要)是当前源文件中找不到的标签,稍后用链接器引用。我可以获取连续声明的许多外部标签(指向代码)的地址吗?而且,这些标签实际上是宏。
以示例解释:
我有一个源A.ASM, acro 宣布为 global :
.macro label n
.global label\n
label\n:
push (n)
ret
和一个源B.masm,带有一些 label(s)< /em>标记为 extern :
labels_array:
.extern label0
.extern label1
我可以用mov
或lea
从<<代码> labels_array ?
这样:
mov $labels_array, %ebx #label0 here
mov 4(%ebx), %eax #label1 here
如果没有,还有另一种方法吗?谢谢。
Extern labels(refers to code or data, does not matter) are labels not found in the current source file and referenced later with the linker. Can I get the address of many extern labels(pointing to code) that are declared consecutively. Also, those labels are actually a macro.
Explaining it with example:
I have a source A.asm with the macro declared as global:
.macro label n
.global label\n
label\n:
push (n)
ret
And a source B.asm, with some label(s) marked as extern:
labels_array:
.extern label0
.extern label1
Can I get the address of each label with mov
or lea
starting from labels_array
?
Like this:
mov $labels_array, %ebx #label0 here
mov 4(%ebx), %eax #label1 here
If not, is there another way? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论