AnsweredAssumed Answered

ASM code folding and assembly extensions

Question asked by canard on Apr 21, 2015
Latest reply on Dec 21, 2015 by Kader.M

We recently decided to write a meta-assembly language for SHARC development. Unfortunately eclipse does not understand code folding on markers like in vim or emacs. We sometime have very long and linear assembly files. The we found is to add braces in order to separate blocks of code.

 

{

  r0 = 2;

  {

     r1 = 3;

  }

}


The braces can be easily removed with `sed` or `perl`.


Moreover, the SHARC macros do not offer good readability. Instead we've added to the meta-language the possibility to write macros like this:


macro MACRO_NAME(a,b) {

   // Inline comments

   r0 = b;

   r1 = a;

}


Which will be expanded into:

 

#define MACRO_NAME(a,b) \

/* // Inline comment */

r0 = b; \

r1 = a; \

/* END OF MACRO_NAME */


Our next step is to be able to use nested C-Struct in assembly. Currently the SHARC assembler does not understand multi-dimensions arrays and nested C structures...

 

I wish these extensions to the SHARC assembly could be integrated in a next release of CCES

Outcomes