Generates stack frame (preprocessing of function).
The following can be specified as imm1/imm2:
list specifies the 12 registers that can be pushed by the prepare instruction.The following can be specified as list.
Absolute expression having a value of up to 12 bits |
The following two specifications are equivalent.
The prepare instruction performs the preprocessing of a function.
Pushes one of the registers specified by the first operand and subtracts 4 from the stack pointer (sp). |
Subtracts the value of the absolute expression specified by the second operand from spNote and sets sp in the register saving area. |
Subtracts the value of the absolute expression specified by the second operand from spNote and sets sp to the register saving area. |
Subtracts the value of the absolute expression specified by the second operand from spNote and sets sp in the register saving area. |
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. |
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. |
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 |
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 |
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. |
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. |
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. |
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. |