One very minor nit:
STRUC Point
.x RESD 1
.y RESD 1
.z RESD 1
ENDSTRUC
SECTION .data
myPoints:
%rep 50
ISTRUC Point
AT Point.x, DB 3
AT Point.y, DB 2
AT Point.z, DB 1
IEND
%endrep
You've defined the elements/members of "Point" as "DD", and initialized them as "DB". I don't think that'll do any harm, but it "looks funny". Might be worth mentioning that we don't have to initialize all the elements. We could do:
STRUC Point
.x RESD 1
.y RESD 1
.z RESD 1
ENDSTRUC
SECTION .data
myPoints:
%rep 50
ISTRUC Point
AT Point.x, DD 3
AT Point.z, DD 1
IEND
%endrep
And all the "Point.y"s would be initialized/padded to zero. The elements we do initialize have to be "in order" as we've declared 'em, but they don't all have to be present. This is probably more confusing to the reader of the code than it is useful, but we can do it. (this is why I don't think it'll do any harm to call 'em "DB").
In cases where we're using "Point_size" (or "TextureImage_size" - Nasm calculates "_size" even if we don't explicitly define it), the size is in bytes, so DB or RESB would be correct in that case.
Seems to me that where the "%rep" mechanism would be especially powerful is if we wanted 50 points (or textures) initialized according to a "formula"...
STRUC Point
.x RESD 1
.y RESD 1
.z RESD 1
ENDSTRUC
SECTION .data
myPoints:
%assign %%xpoint 0
%assign %%ypoint 0
%assign %%zpoint 0
%rep 50
ISTRUC Point
AT Point.x, DD %%xpoint
AT Point.y, DB %%ypoint
AT Point.z, DB %%zpoint
IEND
%assign %%xpoint %%xpoint + 1
%assign %%ypoint %%ypoint + 2
%assign %%zpoint %%zpoint + 3
%endrep
Mmmm... I guess that would have to be in a macro to actually work... something like this?
STRUC Point
.x RESD 1
.y RESD 1
.z RESD 1
ENDSTRUC
%macro thepoints 0
%assign %%xpoint 0
%assign %%ypoint 0
%assign %%zpoint 0
%rep 50
ISTRUC Point
AT Point.x, DD %%xpoint
AT Point.y, DB %%ypoint
AT Point.z, DB %%zpoint
IEND
%assign %%xpoint %%xpoint + 1
%assign %%ypoint %%ypoint + 2
%assign %%zpoint %%zpoint + 3
%endrep
%endmacro
SECTION .data
myPoints: thepoints
If we don't need 'em initialized, I like Bryant's:
SECTION .bss
bsPoints: RESB (50 * Point_size)
Although ".bss" is nominally "uninitialized", it is in fact initialized to zeros (in any sane output format - not true for a .com file). Another option, if we wanted 'em initialized to non-zero, but all the same (very rarely useful, I would think)...
section .data
mypoints times 50 DD 1, 2, 3
(this gets away from the "struc" mechanism - probably less clear)
So there are different ways to do it - "%rep"/"%endrep" probably being the most flexible. Might be "overkill" in this case, but it should work fine.
Best,
Frank