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.
Likewise, macros/directives for function prototypes, arguments and local variables are also used quite often.
The NASMX package http://sourceforge.net/projects/nasmx/ has many higher level support constructs for Nasm developers.
Thanks Scali and p1rahna,
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.
My tutorial can be found here:
http://dkeenan.com/AddingStructuredControlFlowToAnyAssembler.htm
Comments and suggestions are welcome.
-- Dave
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.
My tutorial can be found here:
http://dkeenan.com/AddingStructuredControlFlowToAnyAssembler.htm
Comments and suggestions are welcome.
-- Dave
Thanks Dave for the good info.
Have a great day,
Andy
http://intouch.org/magazine/daily-devotional
http://www.happynews.com
Have a great day,
Andy
http://intouch.org/magazine/daily-devotional
http://www.happynews.com