Basic - Instruction set

  1. Introduction

    Instruction set defines the processor's logic circuit of decoding and handling an instruction. It directly affects the instruction cycle, power consumption. The possible length of pipeline. Instruction set is the most basic thing of implementing a processor.

    One processor may support one or serveral instruction set. There are a couple of instruction sets, such as 8080, AVR, Thumb, ARM, i386, AMD64, x86-64 (Intel 64). [1] If two different vendor processors support the same instruction set, then they may be able to directly run the binary code from the other platform.

    In computer software (not embedded software), there is a type of exectuable program called fat binary, which can run on different processors that use different instruction sets. It is very simple because the fat binary just contains several binary files for each platform. And the OS will automatically choose the correct one to run

  2. ARM instruction set (A32)

    ARM instruction set is a 32-bit instruction set designed by ARM company. It is supported by the both Cortex-A and Cortex-R processors.

    To program in assembly code, it is necessary to know the ARM instruction set and rules.

  3. Thumb instruction set with Thumb-2 technology (T32)

    Initiallly, Thumb (indicated by TDMI, ARM7TDMI, 1995) is an 16-bit instruction set. It is a subset of ARM 32-bit instruction set but encoded into 16 bits length. When executing thumb instruction, it first goes to decode to convert into arm 32-bit instruction. This is done transparently without performance loss. The core of thumb instruction set architecture is same as ARM ISA, such as 32-bit register, address space, and so on. However, it can save about 35% code space compared to 32-bit ARM ISA, and provides 160% of the performance when running in a 16-bit memory system. In other words, Thumb helps increase the code density and reduce the requirement on bus bandwidth.

    Because it is only a subset of ARM and only 16-bit length, not every ARM instruction has the equivalent Thumb instruction. Thus, developers may need to mix the Thumb and ARM instrcution and processors have to support both instruction set. (Thumb is not orthogonal?, e.g. ARM7TDMI can use both ARM instruction and thumb instruction.)

    To deal with problem, in 2003, Thumb-2 technology (introduced in ARM1156 core, it is not a new instruction set) extends the Thumb 16-bit instruction set with additional 32-bit instructions. It is a variable-length instruction set. Aim of Thumb-2 was to achieve code density similar to Thumb with performance similar to the ARM instruction set on 32-bit memory. It provides a balance to the ARM and Thumb. With the Thumb-2 technology, ARM enterred the microcontroller market and release the Cortex-M series.

  4. AArch64 (A64)

    ARMv8-A architecture was announced in October 2011. It support the new A64 instrcution set, which is an 64-bit instruction set.