mov


Moves.

[Syntax]

-

mov reg1, reg2

-

mov imm, reg2

 

The following can be specified for imm:

-

Absolute expression having a value of up to 32 bits

-

Relative expression

[Function]

-

Syntax "mov reg1, reg2"

Stores the value of the register specified by the first operand in the register specified by the second operand.

-

Syntax "mov imm, reg2"

Stores the value of the absolute expression or relative expression specified by the first operand in the register specified by the second operand.

[Description]

-

If the instruction is executed in syntax "mov reg1, reg2", the assembler generates one 16-bit mov machine instruction.

-

If the instruction is executed in syntax "mov imm, reg2", and reg2 is r0, the assembler generates a 48-bit mov machine instruction.

-

If the following is specified as imm in syntax "mov imm, reg2" and reg2 is not r0, the assembler generates one 16-bit mov machine instructionNote.

(a)

Absolute expression having a value in the range of -16 to +15

mov     imm5, reg
mov     imm5, reg

Note

The 16-bit mov machine instruction takes a register or immediate value in the range of -16 to +15 (0xFFFFFFF0 to 0xF) as the first operand.

 

-

If the following is specified as imm in syntax "mov imm, reg2" and reg2 is not r0, the assembler executes instruction expansion to generate one machine instruction.

(a)

Absolute expression exceeding the range of -16 to +15, but within the range of -32,768 to +32,767

mov     imm16, reg
movea   imm16, r0, reg

(b)

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

If all the lower 16 bits of the value of imm are 0

mov     imm, reg
movhi   HIGHW(imm), r0, reg

ElseNote

mov     imm, reg
mov     imm, reg

Note

A 16-bit mov instruction is replaced by a 48-bit mov instruction.

(c)

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

mov     !label, reg
movea   !label, r0, reg
mov     %label, reg
movea   %label, r0, reg
mov     $label, reg
movea   $label, r0, reg

(d)

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

mov     #label, reg
mov     #label, reg
mov     label, reg
mov     label, reg
mov     $label, reg
mov     $label, reg

Note

A 16-bit mov instruction is replaced by a 48-bit mov instruction.

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

When instruction expansion is suppressed by the $NOMACRO directive, this instruction is replaced with a 48-bit mov instruction except for when imm is an absolute expression having a value within the range of -16 to +15.