This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Inline Assembly Parameter example in Definitive guide to Cortex M0/M0+

I was reading The Definitive Guide to ARMCortexM0/M0+ by  

In Chapter 21, under section 21.4.2 GNU Compiler Collection, there is a example function with inline assembly operation:

int my_mul_10(int DataIn)
{
  int DataOut;
    __asm("   movs  r0, %0\n"
          "   movs  r3, #10\n"
          "   mul   r0, r3\n"
          "   movs  %1, r0\n"
          :"=r" (DataOut) : "r" (DataIn) : "cc", "r0", "r3");
  return DataOut;
}



And with the following explanation:

In the code example, %0 is the first input parameter and %1 is the first output parameter. Since the operand order is output _operands, input_operands, and clobbered_operands, “DataOut” is assigned to %0, and “DataIn” is assigned to %1. Since the code changes register R3, it needs to be added to the clobbered operand list.

Shouldn't "DataOut" is assigned to %1 and "DataIn" to %0?

Or am I missing something here?