SCC.131 Week 15 Quiz - ARM Assembly Memory

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/31

flashcard set

Earn XP

Description and Tags

Flashcards generated from lecture notes on ARM assembly and memory access.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

How do you load the value 0x11223344 to register R0?

mov R0, #0x3344; movt R0, #0x1122

2
New cards

Assume R0 = 4, R1 = 2. What is the result value of R0 after the execution of the instruction sub R0, R1?

R0 = 2 (R0 = R0 - R1)

3
New cards

Implement the following arithmetic operations: R1 = 16*R0 + R1/8.

lsl R0, R0, 4; lsr R1, R1, 3; add R1, R0

4
New cards

What is the memory map of the Cortex-M3 processor?

A fixed linear memory map of 4 gigabytes of addressable memory space.

5
New cards

How are unaligned data accesses handled in the Cortex-M3 processor?

Unaligned transfers are converted into multiple aligned transfers.

6
New cards

What type of data does the stack (SRAM region) store?

Stores all local variables and function arguments.

7
New cards

What does the stack pointer register point to?

Points to the bottom of the stack.

8
New cards

What type of data does the heap (SRAM region) store?

Stores data allocated during runtime (e.g., malloc).

9
New cards

What type of data does the global data area (SRAM region) store?

Stores global variables.

10
New cards

What does the program counter (PC) register point to?

Points to the next instruction to be executed.

11
New cards

What does it mean that ARM uses a byte-addressable memory?

Each byte has a unique address.

12
New cards

In the instruction str r0, [r2, #100], how is the target memory address calculated?

Target Memory Address = r2 + 100

13
New cards

What does reg+const addressing mode mean?

reg+const mode: use a register and a constant to compute the read/write address.

14
New cards

What does reg+reg addressing mode mean?

reg+reg mode: use the sum of 2 registers to compute the read/write address.

15
New cards

What does reg+reg<<scale addressing mode mean?

reg+reg<<scale: shift the second register parameter and add to the first register, to compute the read/write address.

16
New cards

What does the .bss section contain?

Contains statically allocated variables that are declared but have not been assigned a value yet.

17
New cards

What does the .data section contain?

Contains initialized static variables, i.e., global variables and static local variables set to a value.

18
New cards

What does the .rodata section contain?

Contains initialized static variables that are constant.

19
New cards

What does the .text section contain?

Contains the executable instructions.

20
New cards

What data type does the '.word' directive define?

4 byte integer.

21
New cards

What data type does the '.byte' directive define?

1 byte integer.

22
New cards

What data type does the '.ascii' directive define?

quote enclosed string.

23
New cards

What data type does the '.asciz' directive define?

null-terminated string.

24
New cards

What does the '.fill repeat, size, value' directive do?

fills memory with a repeated value of size bytes.

25
New cards

What does the '.zero size' directive do?

fill memory with zeroes.

26
New cards

What does the pseudoinstruction ldr r0, =label do?

load register; r0 = &label

27
New cards

What does the 'LDRB' instruction do?

access individual byte in memory, zero extend.

28
New cards

What does the 'LDRSB' instruction do?

access individual byte in memory, sign extend.

29
New cards

What does the 'STRB' instruction do?

stores the least significant byte of the 32-bit register into the specified byte address in memory.

30
New cards

What does the 'LDRH' instruction do?

access 16-bits from memory, zero extend.

31
New cards

What does the 'LDRSH' instruction do?

access 16-bits in memory, sign extend.

32
New cards

What does the 'STRH' instruction do?

stores the least significant 16-bits of the 32-bit register into the specified byte address in memory.