This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
question about writing assembly in c
- From: loody <miloody at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 9 Jan 2009 22:14:28 +0800
- Subject: 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"); \
})