prepare


Generates stack frame (preprocessing of function).

[Syntax]

-

prepare list, imm1

-

prepare list, imm1, imm2

-

prepare list, imm1, sp

 

The following can be specified as imm1/imm2:

-

Absolute expression having a value of up to 32 bits

 

list specifies the 12 registers that can be pushed by the prepare instruction.The following can be specified as list.

-

Register
Specify the registers (r20 to r31) to be pushed, 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.

prepare r26, r29, r31, 0x10
prepare 0x103, 0x10

[Function]

The prepare instruction performs the preprocessing of a function.

 

-

Syntax "prepare list, imm1"

(a)

Pushes one of the registers specified by the first operand and subtracts 4 from the stack pointer (sp).

(b)

Repeatedly performs (a) until all the registers specified by the first operand have been pushed.

(c)

Subtracts the value of the absolute expression specified by the second operand from spNote and sets sp in the register saving area.

 

-

Syntax "prepare list, imm1, imm2"

(a)

Pushes one of the registers specified by the first operand and subtracts 4 from sp.

(b)

Repeatedly performs (a) until all the registers specified by the first operand have been pushed.

(c)

Subtracts the value of the absolute expression specified by the second operand from spNote and sets sp to the register saving area.

(d)

Sets the value of the absolute expression specified by the third operand in ep.

 

-

Syntax "prepare list, imm1, sp"

(a)

Pushes one of the registers specified by the first operand and subtracts 4 from sp.

(b)

Repeatedly performs (a) until all the registers specified by the first operand have been pushed.

(c)

Subtracts the value of the absolute expression specified by the second operand from spNote and sets sp in the register saving area.

(d)

Sets the value of sp specified by the third operand in ep.

Note

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

[Description]

-

If the following is specified for imm1, the assembler generates one prepare machine instruction.

(a)

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

prepare list, imm1
prepare list, imm1
prepare list, imm1, imm2
prepare list, imm1, imm2
prepare list, imm1, sp
prepare list, imm1, sp

 

-

When the following is specified as imm1, the assembler executes instruction expansion to generate two or more machine instructions.
If the instruction is executed in syntax "prepare list, imm1, sp", an absolute expression having a value exceeding the range of 0 to 127 can not be specified for imm1.

(a)

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

prepare list, imm1
prepare list, 0
movea   -imm1, sp, sp
prepare list, imm1, imm2
prepare list, 0, imm2
movea   -imm1, sp, sp

(b)

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

prepare list, imm1
prepare list, 0
mov     imm1, r1
sub     r1, sp
prepare list, imm1, imm2
prepare list, 0, imm2
mov     imm1, r1
sub     r1, sp

 

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

When an absolute expression having a value exceeding the range of 0 to 127 is specified for imm1 in an instruction in the format of "prepare list, imm1, sp", the assembler outputs the following message and stops assembling.

E0550231 : Illegal operand (range error in immediate).

-

When a register that cannot be pushed 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).