1/31
Flashcards generated from lecture notes on ARM assembly and memory access.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
How do you load the value 0x11223344 to register R0?
mov R0, #0x3344; movt R0, #0x1122
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)
Implement the following arithmetic operations: R1 = 16*R0 + R1/8.
lsl R0, R0, 4; lsr R1, R1, 3; add R1, R0
What is the memory map of the Cortex-M3 processor?
A fixed linear memory map of 4 gigabytes of addressable memory space.
How are unaligned data accesses handled in the Cortex-M3 processor?
Unaligned transfers are converted into multiple aligned transfers.
What type of data does the stack (SRAM region) store?
Stores all local variables and function arguments.
What does the stack pointer register point to?
Points to the bottom of the stack.
What type of data does the heap (SRAM region) store?
Stores data allocated during runtime (e.g., malloc).
What type of data does the global data area (SRAM region) store?
Stores global variables.
What does the program counter (PC) register point to?
Points to the next instruction to be executed.
What does it mean that ARM uses a byte-addressable memory?
Each byte has a unique address.
In the instruction str r0, [r2, #100], how is the target memory address calculated?
Target Memory Address = r2 + 100
What does reg+const addressing mode mean?
reg+const mode: use a register and a constant to compute the read/write address.
What does reg+reg addressing mode mean?
reg+reg mode: use the sum of 2 registers to compute the read/write address.
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.
What does the .bss section contain?
Contains statically allocated variables that are declared but have not been assigned a value yet.
What does the .data section contain?
Contains initialized static variables, i.e., global variables and static local variables set to a value.
What does the .rodata section contain?
Contains initialized static variables that are constant.
What does the .text section contain?
Contains the executable instructions.
What data type does the '.word' directive define?
4 byte integer.
What data type does the '.byte' directive define?
1 byte integer.
What data type does the '.ascii' directive define?
quote enclosed string.
What data type does the '.asciz' directive define?
null-terminated string.
What does the '.fill repeat, size, value' directive do?
fills memory with a repeated value of size bytes.
What does the '.zero size' directive do?
fill memory with zeroes.
What does the pseudoinstruction ldr r0, =label
do?
load register; r0 = &label
What does the 'LDRB' instruction do?
access individual byte in memory, zero extend.
What does the 'LDRSB' instruction do?
access individual byte in memory, sign extend.
What does the 'STRB' instruction do?
stores the least significant byte of the 32-bit register into the specified byte address in memory.
What does the 'LDRH' instruction do?
access 16-bits from memory, zero extend.
What does the 'LDRSH' instruction do?
access 16-bits in memory, sign extend.
What does the 'STRH' instruction do?
stores the least significant 16-bits of the 32-bit register into the specified byte address in memory.