Flow Control and Branching Flashcards Preview

Intro To Computing > Flow Control and Branching > Flashcards

Flashcards in Flow Control and Branching Deck (23)
Loading flashcards...
1
Q

What does sequential flow mean

A

the default flow of execution by a computer (after executing one instruction, the next is executed as program counter is incremented)

2
Q

what does the CMP instruction do

A

compare the contents of the two registers

3
Q

To branch away from sequential pattern we use

A

B

4
Q

how does the compare instruction work

A

it performs a subtraction without storing the result, allowing us to determine equality and inequality

5
Q

Reverse subtraction istruction

A

RSB

6
Q

what are the two types of branch instructions

A

conditional and unconditional

7
Q

what is a conditional branch instruction

A

only takes this branch if some instruction is met, based on preceding comparison

8
Q

what is an unconditional branch instruction

A

always takes the branch

9
Q

are branch labels case sensitive

A

yes

10
Q

after the compare instruction what should the conditional branch include

A

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

11
Q

Branch if equal to

A

BEQ

12
Q

branch if not equal

A

BNE

13
Q

branch if lower than

A

BLO

14
Q

branch if lower than or same

A

BLS

15
Q

branch if higher than

A

BHI

16
Q

branch if higher than or same

A

BHS

17
Q

Branch ic less than

A

BLT

18
Q

branch if less tan or equal to

A

BLE

19
Q

branch if greater than

A

BGT

20
Q

branch if greater than or equal to

A

BGE

21
Q

Which are used for signed values

A

BLT, BGT, BLE, BGE

22
Q

what are signed values

A

values where the sign matters eg negative integers

23
Q

What are unsigned values

A

values where the sign doesn’t matter eg 0 and positive integers