如何在汇编中初始化一系列自定义结构
我正在研究一个汇编语言项目,我需要定义一个自定义struct coord
来定义3-D坐标,然后定义coord coord
对象的数组,
这是我的到目前为止:
INCLUDE Irvine32.inc
COORD STRUCT
X WORD ?
Y WORD ?
Z WORD ?
COORD ENDS
.data
coordinates COORD <1, 2, 3>, <5, 10, 15>, <6, 12, 18>, <7, 14, 21>, <8, 16, 24>
当我尝试构建项目时,我会收到这些错误:
error A2163: non-benign structure redefinition: incorrect initializers : COORD
error A2164: non-benign structure redefinition: too few initializers : COORD
error A2164: non-benign structure redefinition: too few initializers : COORD
error A2036: too many initial values for structure
因此,如何正确定义coord
struct struct,该结构代表3-D坐标并定义coord的数组
结构。如果有人可以解释如何做到这一点,为什么这些错误发生了,将不胜感激。
I'm working on an assembly language project where I need to define a custom struct COORD
which defines a 3-D coordinate and then define an array of COORD
objects
Here is my code so far:
INCLUDE Irvine32.inc
COORD STRUCT
X WORD ?
Y WORD ?
Z WORD ?
COORD ENDS
.data
coordinates COORD <1, 2, 3>, <5, 10, 15>, <6, 12, 18>, <7, 14, 21>, <8, 16, 24>
When I try to build the project I get these errors:
error A2163: non-benign structure redefinition: incorrect initializers : COORD
error A2164: non-benign structure redefinition: too few initializers : COORD
error A2164: non-benign structure redefinition: too few initializers : COORD
error A2036: too many initial values for structure
So how do I go about properly defining a COORD
struct that represents a 3-D coordinate and defining an array of COORD
structs. If someone could please explain how to do this any why these errors are happening it would be very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论