Chapter 3: Flow Control, Branch/Data Processing Instructions, and Addressing Modes Flashcards
What is unconditional branching?
Branch always, branch without a condition
What is conditional branching?
branches depending on the status the CPSR
How many bits does ARM dedicate in each instruction to encode conditions?
4 bits
How many possible different conditions are there in ARM?
16 difference conditions
Of ARM’s ___ different conditions, how many are dedicated to a single bit in the CPSR (N, Z, V, C)?
There are 16 possible conditions
Eight possible conditions:
- Four for true
- Four for false
Of ARM’s ___ different conditions, how many are dedicated to compound conditions?
There are 16 possible conditions:
- Six are dedicated to compound conditions
Of ARM’s ___ different conditions, what are the conditions dedicated to non-CPSR related conditions?
There are 16 possible conditions:
- One is dedicated to ALWAYS
- One is dedicated to NEVER
What does a while loop in ARM look like?
While CMP r0, #0
BNE Exit
{code...} B While Exit {Post-loop}
What does a Repeat-Until loop in ARM look like?
Repeat {code…}
CMP r0, #0 BNE Repeat {Post-loop}
What does a for loop in ARM look like?
MOV r0, #10
Loop {code}
SUBS r0, #1 BNE Loop {Post-loop}
A repeat-until loop….
Carries out the code while the condition is false
ARM branch instructions have to keep in mind what?
The pipelining effect of the PC, which is 2 instructions ahead always
The PC is always ____ instructions or ____ bytes ahead of the current instructions
2 instructions ahead
or 8 bytes
Rotate Right Through Carry (RRX) is encoded as what?
Rotate right with zero shift
When appending an S to conditional code, the S can go where?
Before or after the condition
ADDEQS & ADDSEQ
are both valid
When there is no shift at all, what it is encoded as?
Logical left (00) with 0 shift (00000)