Author Topic: Preprocessor patch  (Read 18508 times)

Offline zenixan

  • Jr. Member
  • *
  • Posts: 2
Preprocessor patch
« on: February 13, 2010, 09:36:44 PM »
I realized macro command conditions "%iflabel", which checks whether a label is declared. Is it possible to add this patch to the current version of nasm?

Sorry for my English.

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Preprocessor patch
« Reply #1 on: February 14, 2010, 07:26:38 AM »
Consider sending patch to nasm-devel@ mailing list.
And could you please explain the reason why you need this feature?

Offline zenixan

  • Jr. Member
  • *
  • Posts: 2
Re: Preprocessor patch
« Reply #2 on: February 14, 2010, 01:20:20 PM »
This macro-command needed for writing clean code. For example, we have two structures:
struc struct1

   .first: resd 1

   .second: resw 1

endstruc



struc struct2

   .first: resd 1

   .second: resw 1

endstruc


Initialize field of the structure can be any label outside of the structure. For example,
istruc struct2

   at struct1.second, dw 1

iend

A solution could be used to use a local label: at .second, dw 1.
But coercive testing with macrocommand "%iflabel" excludes external label in the structure.