dispose


Deletes stack frame (post processing of function).

[Syntax]

-

dispose imm, list

-

dispose imm, list, [reg]

 

The following can be specified for imm:

-

Absolute expression having a value of up to 32 bits

 

The following can be specified as list. list specifies the 12 registers that can be popped by the dispose instruction.

-

Register
Specify the registers (r20 to r31) to be popped, delimiting each with a comma.

-

Absolute expression having a value of up to 12 bits
The 12 bits and 12 registers correspond as follows:

 

The following two specifications are equivalent.

dispose 0x10, r26, r29, r31
dispose 0x10, 0x103

[Function]

The dispose instruction performs the postprocessing of a function.

 

-

Syntax "dispose imm, list"

(a)

Adds the value of the absolute expression specified by the first operand to the stack pointer (sp)Note and sets sp in the register saving area.

(b)

Pops one of the registers specified by the second operand and adds 4 to sp.

(c)

Repeatedly executes (b) until all the registers specified by the second operand have been popped.

 

-

Syntax "dispose imm, list, [reg]"

(a)

Adds the value of the absolute expression specified by the first operand to the stack pointer (sp)Note and sets sp in the register saving area.

(b)

Pops one of the registers specified by the second operand and adds 4 to sp.

(c)

Repeatedly executes (b) until all the registers specified by the second operand have been popped.

(d)

Sets the register value specified by the third operand in the program counter (PC).

Note

Since the value actually added to sp by the machine instruction is imm shifted 2 bits to the left, the assembler shifts the specified imm 2 bits to the right in advance and reflects it in the code.

[Description]

-

If the following is specified for imm, the assembler generates one dispose machine instruction.

(a)

Absolute expression having a value in the range of 0 to 127

dispose imm, list
dispose imm, list
dispose imm, list, [reg]
dispose imm, list, [reg]

 

-

If the following is specified for imm, the assembler executes instruction expansion to generate two or more machine instructions.

(a)

Absolute expression exceeding the range of 0 to 127, but within the range of 0 to 32,767

dispose imm, list
movea   imm, sp, sp
dispose 0, list
dispose imm, list, [reg]
movea   imm, sp, sp
dispose 0, list, [reg]

(b)

Absolute expression having a value exceeding the range of 0 to 32,767

dispose imm, list
mov     imm, r1
add     r1, sp
dispose 0, list, [reg]
dispose imm, list, [reg]
mov     imm, r1
add     r1, sp
dispose 0, list, [reg]

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

If r0 is specified by the [reg] in syntax "dispose imm, list, [reg]", the assembler outputs the following message and stops assembling.

E0550240 : Illegal operand (cannot use r0 as destination in RH850 mode).

-

When a register that cannot be popped is specified for list, the assembler outputs the following message and generates a code in which that register is ignored.

W0550015 : Illegal register number, ignored.

-

When an absolute expression having a value exceeding the range of 0 to 4095 is specified for list, the assembler outputs the following message and generates a code in which imm is masked by 0xfff.

W0550014 : Illegal list value, ignored.

-

When an absolute expression that is not a multiple of 4 is specified for imm, the assembler outputs the following message and generates a code in which the lower two bits of imm are ignored.

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