ARM Assembly Data Types and Registers

Van C. Ngo · January 20, 2021

In this post of ARM assembly basics, we will talk about the data types and registers. So let’s get started.

Data types

Similar to high-level programming languages, e.g. C/C++, ARM supports different types of data. Data can be 1:

  • signed and unsinged bytes
  • signed and unsinged halfwords
  • signed and unsinged words

ARM data types

For example, they can be used with load and store operations as follows:

ldr         # Load Word
ldrh        # Load unsigned Half Word
ldrsh       # Load signed Half Word
ldrb        # Load unsigned Byte
ldrsb       # Load signed Bytes

str         # Store Word
strh        # Store unsigned Half Word
strsh       # Store signed Half Word
strb        # Store unsigned Byte
strsb       # Store signed Byte

Registers

The number of registers depends on the versions of ARM processors. However, only 16 first general purpose registers are accessible by user-level code (of course, there are some exceptions). But, here we assume that user-level code will only access the general purpose registers 0-15. The following table lists them and their descriptions 1.

ARM registers