Control Instructions - Week 7 Flashcards

(38 cards)

1
Q

What does CISC stand for?

A

Complex Instruction Set Computer

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

What does RISC stand for?

A

Reduced Instruction Set Computer

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

Why did CISC instruction sets become large and complex?

A

To simplify compilers and improve performance

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

What are the advantages of smaller CISC programs?

A

They use less memory and require fewer instruction bytes to fetch; more instructions fit in cache

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

What characterises CISC instructions?

A

Powerful, complex instructions with complicated decoding

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

What memory model does CISC arithmetic often use?

A

Register–memory architecture

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

What characterises RISC instructions?

A

Simple, uniform instructions typically executed in one cycle

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

What memory model does RISC arithmetic use?

A

Load/store architecture

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

Why CISC instruction sets became large

A

To simplify compilers
To improve performance

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

Advantages of smaller CISC programs

A

Use less memory
Fewer instruction bytes to fetch
More instructions fit in cache

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

CISC characteristics

A

Powerful multi‑step instructions
Complex decoding
Arithmetic may access memory directly
Fewer general‑purpose registers

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

RISC characteristics

A

Simple, uniform instructions
Usually one cycle per instruction
Load/store architecture
More general‑purpose registers

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

RISC trade‑offs

A

More instructions needed
More memory required
Compiler must do more work

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

What are the four stages of the fetch–decode–execute cycle?

A

Fetch, increment PC, decode, execute

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

What are data processing instructions used for?

A

Arithmetic and logical operations

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

What are data storage instructions used for?

A

Moving data into or out of registers or memory

17
Q

What do control instructions do?

A

Change program flow by altering the program counter

18
Q

What do I/O instructions do?

A

Transfer data between CPU/memory and external devices

19
Q

What is an unconditional branch?

A

A branch that always changes the PC

20
Q

What is a conditional branch?

A

A branch taken only if a condition is true

21
Q

What is the purpose of flags?

A

To record ALU results for conditional branching

22
Q

What does the Zero Flag (ZF) indicate?

A

The result of an operation is zero

23
Q

What does the Sign Flag (SF) indicate?

A

The sign of the result (positive or negative)

24
Q

What does the Carry Flag (CF) indicate?

A

A carry out occurred in an arithmetic operation

25
What does the Overflow Flag (OF) indicate?
A signed arithmetic overflow occurred
26
What control structures do conditional branches enable?
Decisions and loops
27
What is a subroutine?
A reusable block of instructions called from elsewhere in a program
28
What must be saved when calling a subroutine?
The return address
29
Where is the return address stored during a subroutine call?
On the call stack
30
What principle does a stack follow?
LIFO (Last In, First Out)
31
Why are stacks used in subroutines?
To store return addresses and support nested/recursive calls
32
How are subroutines called using a stack?
To call a subroutine, the contents of the program counter are pushed onto the stack and the PC is reset to the starting address of the subroutine.
33
How does a program return from a subroutine?
To return, the program counter is reset to the value popped from the stack.
34
Why can subroutines be nested to any depth?
Each call pushes its own return address, so calls can nest as long as there is enough stack space.
35
What is a stack frame?
A block of data stored on the stack that holds all information needed for a single subroutine call.
36
What does the stack frame generally include
The return address Argument variables passed on the stack Local variables (in high level languages) Saved copies of any registers modified by the subprogram that need to be restored
37
How do we push a value onto the stack
decrement the address in the stack pointer and store it there.
38
How do we pop a value from the stack
dereference (get the content of) the address stored in the stack pointer, which is then incremented by one.