This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

question about writing assembly in c


Dear all:
At the end of the letter is the macro excerpted from include\asm-arm\irqflags.h.
I have check the as.pdf but still have questions below:
1. what is "%0" used for? Is that mean r0? After checking the
assembly, it is translated as 'r3'.
    or %0 means the first one available register?
2. what are the last 4 lines used for
        : "=r" (temp)						\
	:							\
	: "memory", "cc");					\
appreciate your help,
miloody


#define raw_local_irq_enable()					\
	({							\
		unsigned long temp;				\
	__asm__ __volatile__(					\
	"mrs	%0, cpsr		@ local_irq_enable\n"	\
"	bic	%0, %0, #128\n"					\
"	msr	cpsr_c, %0"					\
	: "=r" (temp)						\
	:							\
	: "memory", "cc");					\
	})


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]