Hello, I have a function which has some inline assembly. The asm code has the following output/input/clobbered lists:
: : [a] "r" (a), [b] "r" (b), [c] "r" (c) : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "memory" I'm compiling the code with -O2, and using gcc.exe (GCC) 3.4.5 (mingw-vista special r3) The problem that I'm having is: - The c variable is being assigned to r5, even though I'm using it in the asm code. I expected a, b, c to be assigned to r13, r14, r15 - r4 is not pushed/popped in the code generated for the function, so my asm code overwrites it My questions are: - What is the best way to approach this? Should I just specify a, b, c as "m" and mov them to r13,r14,r15 inside my asm code, adding them to the clobbered list? - Why does r4 is not being pushed/popped? Sorry if I'm asking something dumb, I don't have much experience writing inline assembly... Thanks, Conrado
