Author Topic: Dilemma with macro context  (Read 10071 times)

Offline nasm32

  • Jr. Member
  • *
  • Posts: 25
Dilemma with macro context
« on: April 13, 2015, 12:12:13 PM »
I made a switch macro so that it is possible to execute different conditional code inside switches instead of typing the labels manually.

The syntax is like this:

Code: [Select]
   _switch eax
        case 10
        case 20
        case 30
  switch_

case 10-30 gets replaced with some conditional testing. But if I place a switch inside a PROC macro, the %$ macro locals gets in conflict with the %$ locals of the PROC macro. I could search through the context or use %$ %$$ %$$$ etc, but I think it is quite ugly.

Is there a way to solve this issue in a way that I can live with. I am not looking for desperate solutions, but solutions I can live with. The context for the PROC macro could be bad if I place the switch inside a PROC and ENDP macro.

Thanks for any examples.