Forum: ARM programming with GCC/GNU tools Explicitly naming loop labels

Author: Miguel Pires (Guest)
Posted on:

Rate this post
0 useful
not useful

I was wondering if it is possible to explicitly attribute name to the 
labels that mark a loop entry.

By default, those are named something like ".L2".

What I would like is to be able to do something like

asm ("my_loop_label")

and the compilation would yield ARM assembly with that label name at the 
loop entry point.

Is something like that possible?

If not, do you happen to know a way to detect loops in ARM assembly?

Thank you.

Author: Johann L. (gjlayde)
Posted on:

Rate this post
0 useful
not useful
Did you check out asm goto?


This if for gcc >= 4.5 and said to be unstable...

Then, if you program GNU-C building a C-label and passing it to the 
assembler should work. However, I never tried that, look hackish, works 
for local labels only and you probably have to jump indirect.

Maybe most convenient will be to just return some value and jump 
conditionally on that instead of jumping from inside asm.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.