• Cortex A code / function alignment

    Hi !

    I am writing assembly code for some ARMv7a and ARMv8a CPU. I know that code has to be 4 bytes aligned, but I saw in several places (uboot/linux) the ".align 4" GCC directive, which will align to 2**4 = 16 bytes.

    When writing code that will…

  • Why the different encodings?

    Why are there different encodings of instructions?

    What's the idea/background/etc for their co-existence?

    Can different encodings be mixed in the code? (Not ARM encodings with Thumb encodings- without ARM/Thumb mode change,

    but, like A1 and A2 or T1…

  • UPREDICTABLE instructions

    Any idea about instructions marked as UNPREDICTABLE: can it then be UNDEFINED?

    In other words: UNDEFINED REQUIRES the instruction to cause UND-exception, but

    MAY UNPREDICTABLE do that, or does it have to execute normally except that the result may be…

  • From the CPU's point of view, how does it distinguish an assembly code is an ARM code or a Thumb code?

    From the CPU's point of view, how does it distinguish an assembly code is an ARM code or a Thumb code?

    Is there some signal bit represent the code is ARM or Thumb code, this is just my guess.