st


Data is stored.

[Syntax]

-

st.b reg2, disp[reg1]

-

st.h reg2, disp[reg1]

-

st.w reg2, disp[reg1]

Note

For the detail of st.dw, see st23.dw.

 

The following can be specified as a displacement (disp):

-

Absolute expression having a value of up to 32 bits

-

Relative expression

-

Either of the above expressions with LOWW applied

[Function]

The st.b, st.h, and st.w instructions store the data of the lower 1 byte, lower 1 halfword, and 1 word, respectively, of the register specified by the first operand to the address specified by the second operand.

[Description]

-

If any of the following is specified as disp, the assembler generates one st machine instructionNote. In the following explanations, st denotes the st.b/st.h/st.w instructions.

(a)

Absolute expression having a value in the range of -32,768 to +32,767

st      reg2, disp16[reg1]
st      disp16[reg1], reg2

(b)

Relative expression having $label for a label having a definition in the sdata/sbss-attribute section

st      reg2, $label[reg1]
st      $label[reg1], reg2

(c)

Relative expression having !label or %label

st      reg2, !label[reg1]
st      !label[reg1], reg2
st      reg2, %label[reg1]
st      %label[reg1], reg2

(d)

Expression withLOWW

st      reg2, disp16[reg1]
st      disp16[reg1], reg2

Note

The st machine instruction takes an immediate value in the range of -32,768 to +32,767 (0xFFFF8000 to 0x7FFF) as the displacement.

 

-

If any of the following is specified as disp, the assembler executes instruction expansion to generate one or more machine instructions.

(a)

Absolute expression having a value exceeding the range of -32,768 to +32,767, but within the range of -4,194,304+4,194,303

st      reg2, disp23[reg1]
st      reg2, disp23[reg1]

(b)

Absolute expression having a value exceeding the range of -4,194,304 to +4,194,303

st      reg2, disp[reg1]
movhi   HIGHW1(disp), reg1, r1
st      LOWW(disp)[r1], reg2

(c)

Relative expression having #label or label, or that having $label for a label having no definition in the sdata/sbss-attribute section

st      reg2, #label[reg1]
movhi   HIGHW1(#label), reg1, r1
st      LOWW(#label)[r1], reg2
st      reg2, label[reg1]
movhi   HIGHW1(label), reg1, r1
st      LOWW(label)[r1], reg2
st      reg2, $label[reg1]
movhi   HIGHW1($label), reg1, r1
st      LOWW($label)[r1], reg2

 

-

If disp is omitted, the assembler assumes 0.

-

If an absolute expression, a relative expression having !label, a relative expression with #label, or a relative expression with #label and with LOWW applied is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [r0] is specified.

-

If a relative expression with $label, or a relative expression with $label and with LOWW applied is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [gp] is specified.

-

If a relative expression with %label is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [ep] is specified.

-

Specify an st23 instruction to specify an st instruction with a 23 bit-wide disp.

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

If a value that is not a multiple of 2 is specified as the disp of st.h or st.w, the assembler aligns disp with 2 and generates a code. Then, the assembler outputs the following messages.

W0550019 : Illegal operand (immediate must be multiple of 2).