Message board for the users of flat assembler.
> Macroinstructions > Array of structs in a struct
Goto page Previous 1, 2
Second variant emulates times control directive behavior (it expands % symbol in the rest of line with the number of current iteration):
Better yet, since it's macro, you can use macro operators # and ` (backquote/backtick) in data definition
points times 10 POINT %, %*% ;the same as ;points POINT 1, 1 ;points_2 POINT 2, 3 ;points_3 POINT 3, 9 ;points_4 POINT 4, 14 ;... ;points_9 POINT 9, 81 ;points_10 POINT 10, 100
to generate (for example) array of pointers to those structs, and strings (just don't forget to protect them with backslashes enough, so they won't trigger earlier than needed).
points_1 = points; this is needed because subscript names was generated starting with second POINT instance ppoints times 10 dd points_\\#%; imagine they're noncontiguous and randomly spaced npoints times 10 db "points_", \\`%, 0; surely can be done with interpretive layer, but isn't this simpler?
Usefulness of this is questionable; they can't be nested currently (a times 3 times % db % don't expand second times but replaces both %s); no check for count<=0 is done (it fails differently for count<0 and count==0). Quick'n'dirty hack as it is — and I like it.
|09 Feb 2010, 19:14||
ok, I understood this time
thank you a lot baldr, that's kind of you.
|09 Feb 2010, 19:46||
|Goto page Previous 1, 2
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar.
Powered by rwasa.