Question: Wants to read the IF register to see if an interrupt occurred:
Answer: This is CPU register. You can not access it through C code. You have to use inline assembly. Write 0 to it will clear IF bit.