1

Problem: Match each instruction to the proper addressing mode.

Answer:

Addressing mode Instruction
Post-indexed LDR r0, [r1], #2
Register indirect with register offset LDR r0, [r1, r2]
Register indirect with constant offset LDR r0, [r1, #2]
Pre-indexed LDR r0, [r1, #2]!
Register indirect LDR r0, [r1]

2

Problem: Place the registers in their appropriate categories.

Answer:

  • General purpose.
    • r0, r2, r5, r12.
  • Special purpose.
    • LR - Link Register.
    • PC - Program Counter.
    • PSR - Program Status Counter.
    • SP - Stack Pointer.
  • Special purpose but not user accessible.
    • MAR - Memory Address Register.
    • MDR - Memory Data Register.
    • IR - Instruction Register.
  • Uncategorized (fake).
    • AND - Accessible Non-Data.
    • DUD - Data Used Daily.
    • NOR - Non Operating Register.

3

Problem: Arrange the instruction execution operations in the correct order.

Answer:

  1. Fetch instruction.
  2. Decode instruction.
  3. Fetch operand.
  4. Execute instruction.
  5. Store result.

4

Problem: Select the operations needed to calculate the Two's Complement of 5.

Answer:

  1. MVN r0, #5.
  2. ADD r0, r0, #1.

5

Problem: Which of the following instructions is functionally equivalent to ADR r4, label1?

Answer: LDR r4, =label1.

6

Problem: What is a newer version of the ARM instruction set that combines both 16-bit and 32-bit instructions which provides the code density
benefits of 16-bit instructions with the additional performance benefits of access to 32- bit instructions?

Answer: Thumb-2.

7

Problem: What is the assembly language instruction itself called?

Answer: The mnemonic.

8

Problem: Which instruction would you use to load a signed byte of data from memory into register r0?

Answer: LDRSB r0, [r4].

9

Problem: Place the statements in the correct categories.

Answer:

  • Accumulator Instruction Set.
    • Dedicated Accumulator Register.
    • ALU results always go into the accumulator.
    • Used in simple processors.
  • Stack Based Instruction Set.
    • ALU operands and results are stored on the stack.
    • Common to older mainframe computers.
  • Load/Store Instruction Set.
    • ALU can source data from any general purpose register.
    • Data must be loaded from memory into registers.
    • ALU can store results in any general purpose register.
    • Data must be stored from registers into memory.

10

Problem: Which Cortex family is used for embedded computing?

Answer: Cortex-M series.

11

Problem: Place each instruction in the proper category.

Answer:

  • Data transfer.
    • MOV - Move.
    • LDR - Load register.
    • STR - Store register.
  • Data manipulation.
    • ADD - Add.
    • AND - Logical AND.
    • ASR - Arithmetic shift right.
    • DIV - Divide.
    • LSR - Logical shift right.
    • MUL - Multiply.
    • RBIT - Reverse bits.
    • REV - Reverse.
    • SUB - Subtract.
  • Program control.
    • B - Branch.
    • BEQ - Branch if equal.
    • BL - Branch with link.
    • BX - Branch and exchange.

12

Problem: Place the instructions in the correct order to perform the indicated calculation.

Answer:

ADR r4, A
LDR r0, [r4]
ADR r4, B
LDR r1, [r4]
MUL r0, r0, r1
ADR r4, C
LDR r2, [r4]
ADD r0, r0, r2
ADR r4, X
STR r0, [r4]

13

Problem: Which of the following is an advantage of instruction pipelining.

Answer: It increases throughput to achieve one instruction per
clock cycle.