Jump to content

Structured Assembler for the Gnu Assembler

Recommended Posts

Remember this: http://forum.43oh.com/topic/219-adding-structured-control-flow-to-any-assembler/ ?

It was a set of macros that would add _if, _else, _do, _until and similar constructs to an assembly program.

It turned out that this didn't work when using the Gnu Assembler :-(


But I think I've managed to implement similar macros that DO work for the gnu assembler.

They're here:  https://github.com/WestfW/structured_gas


I've tried to do this in a way that will make it easily portable to any of the cpus supported by gas, and

provided implementations for Atmel AVR (tested!) and TI MSP430 (not so much tested.)


Comments welcome.


Link to post
Share on other sites
  • 4 weeks later...

Old school!


One cool trick I've learned that only works in GCC (not CL430) is the &&LABEL operation.  So, in C you can do something like (void*)variable = &&label_in_your_code;


Take this and add some stack manipulations and it is, in fact, how I kill tasks in the gcc-build of OpenTag.  :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...