
The names in parentheses are used by some assemblers, but Microsoft’s toolchain doesn’t use those names. They are conventionally used as follows: Register The ARM instruction set has 16 general-purpose integer registers, each 32 bits wide, and formally named r0 through r15. The architectural terms for data sizes are Term

#Arm emulator code example windows#
Windows runs the processor in little-endian mode and disables the SETEND instruction, so you can’t switch to big-endian even if you tried. The ARM architecture permits little-endian or big-endian operation. From now on, I’m talking only about Thumb-2 mode. I’m not going to cover them at all in this series, since Windows doesn’t use them. In addition to classic ARM mode, Thumb mode, and Thumb-2 mode, there are also Jazelle mode (which executes Java bytecode) and ThumbEE mode. Every instruction is required to begin on an even address, but 32-bit instructions are permitted to straddle a 4-byte boundary. The Thumb-2 mode instruction encoding is variable-length, with a mix of 16-bit instructions and 32-bit instructions.

Windows uses the ARM in a mode known as Thumb-2 mode.² In Thumb-2 mode, some classic features are not available, such as most forms of predication. However, Windows doesn’t use the ARM processor in classic mode, so some of the above statements aren’t true any more. The classic ARM processor generally follows the principles of Reduced Instruction Set Computing (RISC): It has fixed-length instructions, a large uniform register set, and the only operations on memory are loading and storing.
#Arm emulator code example series#
First up in this series is 32-bit ARM.Īs with all of these series, I’m focusing on how Windows 10¹ uses the processor in user mode, with particular focus on the instructions you are most likely to encounter in compiler-generated code. I’ve run out of historical processors that Windows supported, so I’m moving on to processors that are still in support.
