Bird
0
0

Examine this ARM assembly code snippet:

medium📝 Analysis Q6 of 15
ARM Architecture - Power Modes
Examine this ARM assembly code snippet:
    MOV R1, #10
    WFI
    MOV R2, #20

What is the likely issue with this code?
AThere is no issue; the code is valid
BWFI cannot be used between MOV instructions
CMOV instructions cannot use immediate values
DWFI must be preceded by an interrupt enable instruction
Step-by-Step Solution
Solution:
  1. Step 1: Understand WFI behavior

    The WFI instruction puts the processor into sleep mode until an interrupt or event occurs.
  2. Step 2: Check interrupt enable status

    If interrupts are not enabled before WFI, the processor may never wake up, causing a deadlock.
  3. Step 3: Analyze the code snippet

    The snippet does not show any interrupt enable instruction before WFI, which is necessary for proper wake-up.
  4. Final Answer:

    WFI must be preceded by an interrupt enable instruction -> Option D
  5. Quick Check:

    WFI requires interrupts enabled to wake up [OK]
Quick Trick: Enable interrupts before WFI to avoid deadlock [OK]
Common Mistakes:
  • Assuming WFI works without enabling interrupts
  • Believing MOV instructions cannot use immediate values
  • Thinking WFI cannot be placed between instructions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes