简体   繁体   English

为什么在使用nasm编译汇编代码时出现奇怪的错误?

[英]Why I got this strange errors when compiling assembly code using nasm?

Test platform is Linux 32 bit. 测试平台是Linux 32位。

I use 我用

nasm -f elf final.s

to assemble the code, and it generate these errors: 汇编代码,并生成以下错误:

final.s:40454: error: (at:1) `%$strucname': context stack is empty
final.s:40454: error: (at:1) `%$strucstart': context stack is empty
final.s:40454: error: (at:1) `%$strucname': context stack is empty
final.s:40454: error: (at:1) `%$strucstart': context stack is empty
final.s:40454: error: expecting `)'
final.s:40454: error: label or instruction expected at start of line

And here is part of my code: 这是我的代码的一部分:

40451
40452 byte_4092CA     db 89h, 0FFh
40453 off_415E82      dd $LN119
40454 aT              db 'T',0

40454 is the last line of my code. 40454是我的代码的最后一行

I have not seen this kind of error and after a quick google, I can not find any useful stuff. 我没有看到这种错误,并且在快速浏览Google之后,找不到任何有用的东西。

Could anyone give me some help? 谁能给我些帮助吗? Thank you! 谢谢!

--------------update-------------- -------------- --------------更新

I tried to put this line of code to other places, but same errors..., which means it is not some issues with last line 我试图将这一行代码放到其他地方,但是存在相同的错误...,这意味着最后一行没有问题

"at" is a keyword used to initialize a structure. “ at”是用于初始化结构的关键字。 Apparently, Nasm is (very!) confused when you use it as a symbol. 显然,将Nasm用作符号时(非常!)感到困惑。 I thought I knew Nasm pretty well, but this is a new one on me! 我以为我非常了解Nasm,但这对我来说是新的! Just call your variable something else - _aT seems to work... 只是将您的变量称为其他_aT似乎可以正常工作...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM