【问题标题】:Why I got this strange errors when compiling assembly code using nasm?为什么在使用 nasm 编译汇编代码时出现这个奇怪的错误?
【发布时间】:2014-03-24 07:10:57
【问题描述】:

测试平台为 Linux 32 位。

我用

nasm -f elf final.s

组装代码,它会产生这些错误:

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

这是我的代码的一部分:

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

40454 是我的代码的最后一行

我没有看到这种错误,在快速谷歌之后,我找不到任何有用的东西。

谁能给我一些帮助?谢谢!

--------------更新--------------

我试图将这行代码放到其他地方,但同样的错误...,这意味着它不是 最后一行

【问题讨论】:

    标签: assembly nasm


    【解决方案1】:

    “at”是用于初始化结构的关键字。显然,当您将 Nasm 用作符号时,它(非常!)感到困惑。我以为我很了解 Nasm,但这是我的新人!只需将您的变量称为其他名称 - _aT 似乎有效...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-27
      • 2013-02-25
      • 1970-01-01
      • 2018-11-16
      • 2014-10-29
      • 1970-01-01
      • 2016-01-28
      相关资源
      最近更新 更多