Forum: ARM programming with GCC/GNU tools Multiple Output Variables in asm code

von Nikshep P. (nikshep)

Rate this post
0 useful
not useful

Please let me know how to specify multiple output variables in ARM asm
My problem is conversion of the following C code to ARM asm -

C Code -

t0 = abs(t0);
sc += (t0 > 0);

I want to convert this to assembly. The following is one of the possible
implementations. But this implementation doesnt allow to have both 't0'
and 'sc' as outputs -

   "CMP     %2, #0\n\t"
   "RSBLT   %1, %2, #0\n\t"
   "ADDNE   %0, %0, #1"
   : "=&r" (sc), "=r" (t0)
   : "r" (t0)

Can anyone suggest me a way to have both 'to' and 'sc' as output
variables without writing separate asm codes for the two steps...


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.