I figured out a simple way to add structured control-flow (IF ELSE ENDIF WHILE FOR etc) to almost any assembler, using macros. The generated code is exactly the same as if you had used labels and jumps/branches, but it doesn't read like spaghetti. Is something like this this already well known? If not, does anyone care? -- Dave Keenan

MASM comes with a lot of those macros built-in, and especially in the Win32ASM world, they are commonplace. You'll find them being used often in tutorials for example (eg Iczelion's tutorials).Likewise, macros/directives for function prototypes, arguments and local variables are also used quite often.

I'm glad to learn that the x86 community at least has the benefit of built-in support for structured control-flow. I decided to write up my method anyway, since it seems there are many processors for which no such assembler is available, or for which the free assemblers have no such support. And because you may not like the way the built-in support works and may want to define your own or extend the existing.