bool flag;
void foo()
{
while (!flag)
{
asm(" ldr r2,[pc,#0] \n" /* r2 = address of flag */
" b .+8 \n" /* jump over constant */
" DCD flag \n" /* address of flag */
" ldr r3,[pc,#0] \n" /* r3 = address of PIND */
" b .+8 \n" /* jump over constant */
" DCD PIND \n" /* address of PIND */
" ldr r0,[r3] \n" /* r0 = PIND */
" str r0,[r2]"); /* flag = r0 */
}
}