NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: sergioortega1 on April 24, 2019, 01:41:41 AM
-
This is part of my code:
SECTION .data
Head: ISTRUC Node
AT Node.Value, dd 0
AT Node.NextPtr, dd Second
AT Node.PrevPtr, dd Tail
IEND
Second: ISTRUC Node
AT Node.Value, dd 0
AT Node.NextPtr, dd Tail
AT Node.PrevPtr, dd Head
IEND
Tail: ISTRUC Node
AT Node.Value, dd 0
AT Node.NextPtr, dd Head
AT Node.PrevPtr, dd Second
IEND
I am getting the error "non-constant argument supplied to TIMES" for each line that uses "IEND".
Any help would be greatly appreciated.
-
From NASM doc:
The function of the AT macro is to make use of the TIMES prefix to advance the assembly position to the correct point for the specified structure field, and then to declare the specified data. Therefore the structure fields must be declared in the same order as they were specified in the structure definition.
And, so, this works:
bits 64
default rel
section .data
struc mystruc
.value: resd 1
.next: resq 1
.prev: resq 1
endstruc
p: dq 0
mylist:
istruc mystruc
at mystruc.value, dd 1
at mystruc.next, dq p
at mystruc.prev, dq p
iend