Everything

ld, st


-

The device has the following ld and st instructions, and each instruction has a disp16 or disp23 operand.

-

(1) LD.B, LD.BU, LD.H, LD.HU, LD.W

-

(2) ST.B, ST.H, ST.W

 

In asrh, the following mnemonics need to be specified when disp23 is to be explicitly specified for these instructions.

-

(1) ld23.b, ld23.bu, ld23.h, ld23.hu, ld23.w

-

(2) st23.b, st23.h, st23.w

 

-

The device also has the following ld and st instructions.

-

(3) LD.DW

-

(4) ST.DW

 

In asrh, these instructions can be specified in either format because the meaning is the same.

-

(3) ld.dw, ld23.dw

-

(4) st.dw, st23.dw

 

-

If any of the following is specified for disp16, the assembler performs instruction expansion to generate multiple 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 to +4,194,303

Format

Result of Assembly

ld.w    disp[reg1], reg2
ld.w    disp23[reg1], reg2

(b)

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

Format

Result of Assembly

ld.w    disp[reg1], reg2
movhi   HIGHW1(disp), reg1, r1
ld.w    LOWW(disp)[r1], reg2

(c)

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

Format

Result of Assembly

ld.w    #label[reg1], reg2
movhi   HIGHW1(#label), reg1, r1
ld.w    LOWW(#label)[r1], reg2
ld.w    label[reg1], reg2
movhi   HIGHW1(label), reg1, r1
ld.w    LOWW(label)[r1], reg2
ld.w    $label[reg1], reg2
movhi   HIGHW1($label), reg1, r1
ld.w    LOWW($label)[r1], reg2

 

-

If disp is omitted, the assembler assumes 0.

-

If an absolute expression, a relative expression having !label, a relative expression having #label, or a relative expression having #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 having $label, or a relative expression having $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 having %label is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [ep] is specified.