为什么我不能在 masm 中定义这个符号?
我刚刚开始学习英特尔汇编,但我在这个简单的程序中遇到了麻烦。
main PROC ;program execution begins here
A = 1 ;define A with 1
B = 12o ;define B with 12 octal
X dword A1h ;initialize the variable X with value A1 hex
Y dword 11001001b ;initialize the variable Y with value 11001001 binary
SUM dword 0 ;initializes the sum variable to 0
ADD EAX, A ;adds A to sum
ADD EAX, B ;adds B to sum
ADD EAX, X ;adds X to sum
ADD EAX, Y ;adds Y to sum
MOV SUM, EAX ;
exit ;end of program
main ENDP
但每当我尝试构建它时,它都会显示“错误 A2006:未定义符号:A1” 如果有人能帮助我那就太好了。
I'm just starting to learn intel assembly and I'm having trouble with this simple program.
main PROC ;program execution begins here
A = 1 ;define A with 1
B = 12o ;define B with 12 octal
X dword A1h ;initialize the variable X with value A1 hex
Y dword 11001001b ;initialize the variable Y with value 11001001 binary
SUM dword 0 ;initializes the sum variable to 0
ADD EAX, A ;adds A to sum
ADD EAX, B ;adds B to sum
ADD EAX, X ;adds X to sum
ADD EAX, Y ;adds Y to sum
MOV SUM, EAX ;
exit ;end of program
main ENDP
but whenever I try to build this it says "Error A2006: undefined symbol : A1"
if anyone could help me that'd be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你必须写0A1h,因为A1h看起来像一个变量名。
You have to write 0A1h because A1h looks like a variable name.
这表示要在以 0 http://www.piclist.com 的字母开头的十六进制值前面添加/techref/language/masms.htm
This says to prepend hex values starting with letters with a 0 http://www.piclist.com/techref/language/masms.htm