Mail Archives: djgpp/1995/07/21/20:22:36
>>>>> "Roberto" == Roberto Alsina <ralsina AT ultra4 DOT unl DOT edu DOT ar> writes:
Roberto> 1) The routine makes a jump to a label, that's ok, but
Roberto> when compiling whit -O3, it gets inlined, so the label
Roberto> gets duplicated everywhere the function is called, and
Roberto> the program won't compile. Is there something like a
Roberto> "not_inline" directive to tell the compiler NOT to inline
Roberto> that function?, or a way to define a local label? (i saw
Roberto> it on the info files, but i couldn't make it work, if
Roberto> somebody has, please send me an example).
Sure. Local labels are of the form 1:, 2:, 3:, etc. When you want to
reference a local label, you say either "2f" or "2b" (for example),
which means "the next `2:' forward" and "the previous `2:' backward",
respectively. So:
asm ("jmp 2f\n"
"1:\n\t"
"nop\n"
"2:\n\t"
"jmp 1b");
Roberto> 2) How do i reference a local variable (or label) or an
Roberto> argument passed to a function from an asm? _varname only
Roberto> seems to work with globals.
List it in the input or output operands to the asm. The syntax for
doing this is explained in the gcc info pages.
-Mat
- Raw text -