私はいくつかの xtensa アセンブリ コードを読み取ろうとしていますが、次のL32R
命令に困惑しています。
たとえば、次の行が与えられます。
0000 2f04 <my_func>:
2f0c: ffef21 l32r a2, 2ec8
これはどのアドレスをロードしますか?
Xtensa Instruction Set Architecture Reference Manualマニュアルの382 ページにはl32r
、アドレスは次のように計算されると記載されています。
L32R forms a virtual address by adding the 16-bit one-extended constant value encoded
in the instruction word shifted left by two to the address of the L32R plus three with the
two least significant bits cleared. Therefore, the offset can always specify 32-bit aligned
addresses from -262141 to -4 bytes from the address of the L32R instruction. 32 bits
(four bytes) are read from the physical address.
したがって、上記の例を続けると、定数の操作:
ffef 16-bit constant
ffff ffef 16-bit constant one-extended
ffff ffbc shifted left by two
PCの操作:
0000 2f0c program counter
0000 2f0f pc +3
0000 0f0c masked bits 0 and 1
仮想アドレスの計算:
ffff ffbc
+ 0000 2f0c
===========
1 0000 2ec8
したがって、16 ビットを超えるものはすべて破棄します。2ec8
L32R 命令は、指定されたアドレスから 32 ビット値をロードします。したがって、「l32r a2, 2ec8」は、アドレス 0x2ec8 にある 32 ビット値をレジスタ a2 にロードします。逆アセンブリでその場所を確認する必要があります。