ARMv8-A Architecture Flashcards
Which type of Architecture is ARMv8? (RISC or CISC)
RISC
Is the ARMv8 a Load/Store Machine?
Yes
How many registers does the Register file contain?
Register file contains 31 64-bit registers
Which data is manipulated by most instructions in the registers?
32-bit or 64-bit data
What are the 2 execution states of ARMv8 architecture?
AArch64 and AArch32
What does the AArch64 execution state use?
Uses the A64 Instruction set and 64-bit registers
What does the AArch32 execution state use?
Uses the A32 or T32 Instruction sets (provides computability with older ARM and THUMB instruction sets using 32-bit registers)
What are the ARMv8’s 4 exception levels
EL0 - for normal user apps with limited privileges EL1 - for the OS kernel EL2 - for a Hypervisor EL3 - Low-Level firmware
EL0
- Restricted access to a limited set of instructions and registers - Most programs work at this level
EL1
- Privileged access to instructions, registers and memory - Accessed indirectly by user programs using system calls - Lots of System registers accessible only in EL1 and used in OS kernel code
EL2
- Support virtualization, where the computer hosts multiple guest OSs, each on its own virtual machine
EL3
- Include the Secure Monitor
How many General-purpose registers does AArch64 have? What are they numbered as? When using all 64 bits, use? When using only the lower-order 32 bits, use?
31 64-bit wide general-purpose registers Numbered from 0 to 30 x or X (eXtended) w or W (Word)
Register uses: x0-x7 x8 x9-x15 x16-x17
x0 - x7: to pass args into a procedure and return results x8: indirect result location register x9 - x15: temp registers x16 - x17: intra-procedure-call temp registers (IP0, IP1)
Register uses: x18 x19-x28 x29 x30
x18: platform register x19 - x28: callee-savee registers (value is preserved by any function you call) x29: frame pointer (FP) register x30: procedure link register (LR)
Special-Purpose Registers: (Use/Types)
Stack Pointer - Points to top of run-time stack SP: 64-bit WSP: 32-bit Zero Register - Gives 0 value when read from and discards value when written to XZR: 64-bit WZR: 32-bit Program Counter - Holds address of currently executing instruction / Can’t be accessed directly as a named register / Is changed indirectly by branch and other instructions / Is used implicitly by PC-relative load/stores PC: 64-bit
How many floating-point registers are there?
32 128-bit wide floating-point registers
What is an immediate value and how can it be used?
An immediate value (a constant) may be used as final source operand or some instructions
Which symbol is optional when using gcc?
A # symbol can prefix the immediate, but is optional when using gcc
How many constants are allowed
It depends on the particular instruction and how many bits are available within the machine instruction
Prefixes to prevent immediates to be assumed as decimals
Hexadecimal: 0x Octal: 0 Binary: 0b
Why use aliases?
mov x29, sp is alias for add x29, sp, 0 provided for readability and programmer convenience
Commonly used instructions
- Move immediate mov Wd, #imm32 [-(2^31) to +(2^32) - 1] mov Xd, #imm64 [-(2^63) to +(2^64) - 1] - Move register mov Wd, Wm [alias for orr Wd, wzr, Wm] mov Xd, Xm [alias for orr Xd, xzr, Xm]