Date: Fri, 21 Jul 95 17:39 MDT From: mat AT ardi DOT com (Mat Hostetter) To: Roberto Alsina Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Inline assembler References: <9507211256 DOT AA29805 AT sun DOT soe DOT clarkson DOT edu DOT soe> >>>>> "Roberto" == Roberto Alsina 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