Inline assembler of Thumb2 architecture

This document assumes that you are familiar with assembly language programming, so you should read this document after studying the tutorial( tutorial). For a detailed description of the instruction set, see《Architecture Reference Manual》. The inline assembler supports a subset of the ARM Thumb-2 instruction set described here. This syntax tries to be as close as possible to the syntax defined in the above ARM manual for conversion to Python function calls.

Unless otherwise stated, the instruction operates on 32-bit signed integer data. Most supported instructions only run on registers R0-R7 : If it support R8-R15 , then explain. Before returning from the function, the registers R8-R12 must be restored to their initial values. The registers R13-R15 constitute the link register, stack pointer and program counter respectively.

File specification

Where possible, the behavior of each instruction is introduced in Python, for example

  • add(Rd, Rn, Rm) Rd = Rn + Rm

This supports demonstration of the effect of instructions in Python. In some cases, this is not feasible because Python does not support concepts such as indirect methods. In the relevant page, the virtual program code used in this case is introduced.

Reference list