Author Topic: NASMX questions  (Read 3393 times)

Offline rdtsc

  • Jr. Member
  • *
  • Posts: 6
NASMX questions
« on: January 25, 2011, 08:59:24 PM »
Downloaded NASMX , it is really cool, but i have 1 question

Is it really necessary to include the whole  nested structure definition in parent structure? Example:
Code: [Select]
NASMX_STRUC S2, coord
NASMX_RESERVE x, dword, 1
NASMX_RESERVE y, dword, 1
NASMX_ENDSTRUC

NASMX_STRUC S1
NASMX_RESERVE, time,dword,1
NASMX_STRUC S2, coord
NASMX_RESERVE x, dword, 1
NASMX_RESERVE y, dword, 1
NASMX_ENDSTRUC
NASMX_ENDSTRUC

Is it possible (or may be will be possible in fututre?) to do it without full including (as in C) ? Example:
Quote
struct s2{
  int x;
  int y;
};

struct s1 {
    int time;
    struct s2 coord;
};

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: NASMX questions
« Reply #1 on: January 26, 2011, 01:20:30 AM »
That is a good suggestion.  It would require checking for a predefined struct name, remembering the names of each of the pre-defined structure elements, then iterating through the list and defining offsets for the current struct.  The include headers would have to change to use it, but it sounds workable...