Flow Control and Branching 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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does the CMP instruction do

A

compare the contents of the two registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

To branch away from sequential pattern we use

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how does the compare instruction work

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Reverse subtraction istruction

A

RSB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are the two types of branch instructions

A

conditional and unconditional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a conditional branch instruction

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is an unconditional branch instruction

A

always takes the branch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

are branch labels case sensitive

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Branch if equal to

A

BEQ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

branch if not equal

A

BNE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

branch if lower than

A

BLO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

branch if lower than or same

A

BLS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

branch if higher than

A

BHI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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