Embedded Systems 1 - Arm Assembly

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/33

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

34 Terms

1
New cards

ARM CPU - registers

30 registers, general purpose 32-bit, but only 15 visivle at a time

2
New cards

Register types

general: R0 to R12

SP or stack pointer, used by compilers for stack location: R14

PC register - points to next instruction, loaded with branch destination: R15

3
New cards

RISC attributes

instructions take one clock to execute, more advanced instructions such as multiplies, divides and FP instructions take more time

4
New cards

Load-Store Architecture

memory locations operations can only be move (load/store), load memory to registers/store memory from registers

5
New cards

What is a major difference between ARM RISC and x86 CISC?

all ALU instructions are done in ARM registers, which greately simplifiers the archiecture of the ARM processor

6
New cards

Four data types in ARM

Bit, Byte (8-bit), Half-word (two byte, 16-bit), word (4 byte, 32-bit)

7
New cards

MOV instruction

MOV R5, #5 --> can only be used when number can be represented in 12 bits

MOV R5, R2 (R5=R2)

MOV R0, XZR (XZR is a special register that always reads 0)

8
New cards

LDR instruction

LDR Rd, = k

- Rd = k //k is 32 bit

LDR X2, [X3] --> loads value at that address into X2 (creates a pointer)

LDR X0, =label --> loads address of a label

9
New cards

Simple Arithmetic Instructions

ADD R5, R2, R1 // R5 = R2 + R1

SUB R5, R9, #23 // R5 = R9 - 23 (immediate limited to 8 bits for ALU instructions)

10
New cards

Von Neumann Architecture

A processor where data and instructions are stored in the same memory and accessed via buses (same path), simpler but slower performance in high-power computing

11
New cards

Harvard Architecture

seperate memory for data and instructions, allows both data and instruction to be fetched simultaneously (parallel), but more complex

12
New cards

Modern Processors: Hybrid

VN for: main memory & I/O, less I/O

Harvard: internal cache with seperate instruction and data access, higher performance without bus contention

13
New cards

L1 Cache (RP4)

Harvard (smaller, seperate for instructions and data), faster access speed

14
New cards

L2 & main memory (RP4)

Von-neumann (1 MB shared by all), larger & more flexible

15
New cards

Memory Management Unit (MMU)

converts virtual addresses from programs to physical addresses for RAM

16
New cards

STR instruction (indirect addressing)

STR Rx, [Rd]

store contents of Rx into memory address in RD, square brackets means indirect addressing

17
New cards

LDR (Immediate addressing)

LDR Rx, =k

load constant value directly into register

18
New cards

LDR v. STR

LDR does memory address --> register, STR does register --> memory address

LDR R0, [R1] --> load value at R1 into register R0

STR R0, [R1] --> store value in R0 into memory address stored in R1

19
New cards

ARM is little endian

it means the LSB is stored at the lowest memory address

20
New cards

N-flag

Bit 31, N = 1 set is signed value is negative

21
New cards

Z-flag

Bit 30, Z = 1 set if result is 0

22
New cards

C-flag

Bit 29, C = 0 when there is a borrow (subtraction) and C = 1 if overflow with addition

23
New cards

V-flag

Bit 28, set (V=1) if there is signed overflow --> basically when a + num looks - or a - num looks +

24
New cards

real instructions

direct instructions to cpu such as mov and add

25
New cards

pseudo instructions

translated to real instructions by assembler such as ldr (allow for using intermediate loads of 32-bits while mov onyl allows for 8-bit)

26
New cards

assembler directives

ex) .data, .global (for the assembler, not translated to machine code) --> initialize variables, reserve memory, define sections (labels)

27
New cards

assembler directive: .text

tells assembler code section begins

28
New cards

assembler directive: .data

initialized data section begins

29
New cards

assembler directive: .global

inform assembler that a name or symbol will ne referenced in other files

30
New cards

assembler directive: .equ

sets values to variable names

31
New cards

assembler directive: .include

informs assembler to include information from another file

32
New cards

assembler directive: .extern

informs assembler code accesses a name defined in another file

33
New cards

RISC architecture

fixed instruction size, makes decoding easier, reduced number of transitors, load/store, hybrid architecture (VN & H), 32 registers, most instructions that take more than 1 clock --> but can lead to using more memory, inflexible

34
New cards

CISC Architecture

instructions have different lengths