Flow Control and Branching Flashcards
What does sequential flow mean
the default flow of execution by a computer (after executing one instruction, the next is executed as program counter is incremented)
what does the CMP instruction do
compare the contents of the two registers
To branch away from sequential pattern we use
B
how does the compare instruction work
it performs a subtraction without storing the result, allowing us to determine equality and inequality
Reverse subtraction istruction
RSB
what are the two types of branch instructions
conditional and unconditional
what is a conditional branch instruction
only takes this branch if some instruction is met, based on preceding comparison
what is an unconditional branch instruction
always takes the branch
are branch labels case sensitive
yes
after the compare instruction what should the conditional branch include
the condition under which we don’t want to follow the sequential flow but in which we want to end the program or go to the else part. So it should be the opposite condition of what we want
Branch if equal to
BEQ
branch if not equal
BNE
branch if lower than
BLO
branch if lower than or same
BLS
branch if higher than
BHI