Immediate  -  ARM Register offset calculator

by Matt Browne


Working out the most effective way of moving a number into an ARM register is often tricky to get right 100% of the time - resulting in annoying Bad immediate constant or Immediate value ... out of range errors. An immediate constant is a number specified after a # character in ARM instructions - like the MOV
and ADD instructions. Unfortunately, due to restrictions in the format of ARM instructions, it isn't possible to say MOV R1,#&4B534154 - immediate constants have to be encoded with the rest of the instruction into one 32-bit word. Immediate lets you check very easily whether an immediate constant can be included in one instruction.

 Copyright RISC User Magazine 1997
