Week 12: Block move, Block move encoding/decoding, Subroutine call/return, and summary Flashcards

1
Q

The ARM block move instructions are

A

LDM and STM

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

STM does what?

A

Push a group of registers’ contents to memory

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

LDM does what?

A

Pop values from memory and load them to a group of registers

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

What is the syntax of using STM or LDM?

A

ADR r0, DATA

STMIA r0!, {r1 - r3, r5}

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

What indicates auto indexing for LDM and STM?

A

The ! exclamation mark:

STM r0!
LDM r0!

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

Arm STM and LDM instructions always store the ___ first and in _____

A

The lower register number in the LOWEST memory address first and the higher register number in the HIGHEST memory address first.

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

What do the following mean?

FD
IA
IB
DA
DB
ED
EA
FA
A
FD = Full Descend
IA = Increment After
IB = Increment Before
DA = Decrement After
DB = Decrement Before
ED = Empty Descend
EA = Empty Ascend
FA = Full Ascend
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the load/store suffixes of the following stack types?

FD
FA

ED
EA

A

FD (Full Descend)
Load: IA
Store: DB

FA (Full Ascend)
Load: DA
Store: IB

ED (Empty Descend)
Load: IB
Store: DA

EA (Empty Ascend)
Load: DB
Store: IA

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

FD, FA, ED, and EA are examples of

A

Pseudo notations

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

The difference between ARM’s block move instructions are:

A

The direction (up/down) and whether the pointer points to free memory or not

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

How does the “register list” portion of a block move instruction work?

A

From right to left, every bit that is a 1 is included in the register list from r0 - r15

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

What is a subroutine?

A

A set of instructions that may be repeatedly called by a program to do a given function

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

What are the two main characteristics in any subroutine?

A
  1. A subroutine can be called from anywhere in the program

2. Once the subroutine is completed, it should return to the instruction directly AFTER the subroutine calling location

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

What is ARM’s support for Subroutines?

A

BL, branch with link automatically saves the return address in register 14

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

BL does what on top of branching?

A

The processor also copies the return address into R14 (the link register)

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

To return from a subroutine call, you simply

A

Copy the return address into the PC

17
Q

A subroutine call can also be implemented by means of

A

Pushing the return address onto the stack and branching to the target address, then returning by popping the return address from the stack and copying the address into the PC

18
Q

If the routine is not a leaf routine, you cannot

A

Call another routine without first saving the link register

19
Q

To save register data before a subroutine call, what must be done?

A

You must save the information in the registers by pushing the information onto the stack by means of a STM and then afterwards pop them off by means of a LDM

20
Q

If you are using a block move to restore registers from the stack, you can also include the

A

Program Counter

21
Q

If you plan on including the program counter with the STM and LDM, what must be done?

A

You must ensure the return address is saved in r4, the LR