`ldm/stm` in gcc inline ARM assembly
问题 I am trying to create an ldm (resp. stm ) instruction with inline assembly but have problems to express the operands (especially: their order). A trivial void *ptr; unsigned int a; unsigned int b; __asm__("ldm %0!,{%1,%2}" : "+&r"(ptr), "=r"(a), "=r"(b)); does not work because it might put a into r1 and b into r0 : ldm ip!, {r1, r0} ldm expects registers in ascending order (as they are encoded in a bitfield) so I need a way to say that the register used for a is lower than this of b . A