Skip to content

Blog#

ARM Program Counter

In the A32 and T32 instruction sets, the Program Counter(PC) and Stack Pointer(SP) are general purpose registers. This is not the case in A64 instruction set.

As a general-purpose register in ARMv7, the PC introduced compiler complications and complex pipeline design.

Removing direct access to the PC in ARMv8 makes return prediction easier and simplifies the ABI specification.

Register file of ARM64

The ISA is a contract between the hardware and the software. It defines the set of instructions and the set of registers that the hardware must support.

The most important components of the CPU are the registers, where data is stored, and the arithmetic and logic unit (ALU), where arithmetic and logical operations are performed on the data.

Arm® processors provide general-purpose and special-purpose registers. Some additional registers are available in privileged execution modes.

Registers which can be used freely are referred to as volatile, and registers which must be preserved or restored before returning are referred to as non-volatile.

Arm GNU Toolchain

How to compile/generate AArch32 code and run on an Linux/AArch64?

How to build AArch64-ELF for a popular embedded target board under Windows/x86_64 or macOS/arm64?

ARM Programmer's Guide

  1. ARM Cortex-A Series Programmer's Guide for ARMv8-A
  2. Arm Assembly Language Reference Guide
  3. ARM Compiler armasm Reference/User Guide
  4. Arm Compiler for Embedded Reference/User Guide

ARM Architecture

ARM's original abbreviation was Acorn RISC Machine.

The cores and instruction sets used by ARM do not correspond one-to-one.

In November 1990, Acorn, Apple and VLSI jointly funded the creation of ARM. Acorn RISC Machine has also been officially renamed Advanced RISC Machine.

After ARM11, ARM processor cores no longer have the ARM prefix. But the word ARM has not disappeared from the Cortex series. The three major series of Cortex, M-R-A, together are ARM.

CPU Architectures

有5种指令集最为常见,它们构成了处理器领域的5朵金花。

  1. x86——硕大的大象
  2. ARM——稳扎稳打的蚁群
  3. MIPS——优雅的孔雀
  4. Power——昔日的贵族
  5. C6000——偏安一隅的独立王国

This article is about the collection of datasheet/textbooks/references on the three major mainstream CPUs.

计算机中有符号数的表示

对于无符号整数,一般来说,所有的数位都被用来表示数值。
对于带符号整数,数位被划分为符号位(只能占一位)与数值位(剩余的其它位)。

符号位的权值有不同的解释:

  1. 权值是零(符号位是“1”则表示数值为负),称为“符号-绝对值”模式(Sign and magnitude)。
  2. 权值是 –(2N-1-1),“1的补码”方式(Ones’ complement)。
  3. 权值是 –2N-1,“2的补码”方式(Two's complement)。