SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
Store Halfword to Memory with a GDP-Relative 19-Bit Unsigned Constant Offset
STH dst, *+GDP[ucst19]
Functional unit = D
32 bit
31 | 16 | 15 | 13 | 12 | 10 | 9 | 0 |
ucst19 | dst | ucst19 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
16 | 3 | 3 | opcode |
The 16 LSBs (byte) of dst are stored to memory (effective address). The memory address is formed from the global data pointer register (GDP) and an offset (number of halfwords) that is a 19-bit unsigned constant (ucst19). If an offset is not given, the assembler assigns an offset of zero. You must type the brackets, [ ], around the specified offset, if you use the optional offset parameter.
The square brackets, [ ], indicate that the ucst19 is scaled by a left-shift of 1 bit. After scaling, ucst19 is added to GDP. The result of the calculation is the effective address in memory that contains the content from dst.
Halfword addresses must be aligned on halfword (LSB is 0) boundaries.
None
*(GDP[ucst19]) = *dst