Jump to content

d.keenan

Members
  • Content count

    6
  • Joined

  • Last visited

  • Days Won

    1
  1. I finally got around to combining some excellent ideas from @westfwBill Westfield's GNU assembler version with my first version, to describe a method that really will work with ANY assembler that allows macros. Thanks Bill! http://dkeenan.com/AddingStructuredControlFlowToAnyAssembler.htm And this time I've provided a link to source code (for the IAR/MSP430 version) that should be easily modified for any assembler or target. https://github.com/dkeenan7/LyteFyba/blob/master/common/ControlFlowMacros.h
  2. I have updated Part 2 with far more readable macros to implement structured short-circuit conditionals in assembly language, that don't require overlapping structures. http://dkeenan.com/AddingStructuredControlFlowToAnyAssembler2.htm
  3. Part 2 of "Adding Structured Control-flow to any* Assembler" is now available. It covers short-circuit conditionals, case/switch statements and counted loops. http://dkeenan.com/AddingStructuredControlFlowToAnyAssembler2.htm
  4. Eek! I take it all back about it being a piece of cake. Sadly it appears to be impossible to use this method with the gnu assembler. From the manual: Translation:
  5. Thanks for the thanks. I thank the Forth gurus before me who came up with that elegant minimalist stack-based label-free method for implementing structured control-flow almost on the bare silicon. My only contribution was to realise that since you only need a very shallow stack it could be added to any existing macro assembler, by "brute force" as you say. Sorry I don't have the macros in Gnu assembler syntax. But for someone familiar with that assembler it should be a piece of cake to translate them. Email me, as per the end of the article, if you need help. -- Dave Keenan
  6. If your assembler doesn't already have structured control-flow, e.g. _IF _ELSE _ENDIF _UNTIL _WHILE etc (not to be confused with conditional assembly) then here's how to add it yourself for free, without needing access to the assembler's source code. http://dkeenan.com/AddingStructuredControlFlowToAnyAssembler.htm Structured control-flow eliminates the need for most explicit jumps, and the labels they jump to, and thereby makes your code more readable and maintainable. -- Dave Keenan
×