Everything

prepare, dispose


-

The prepare and dispose instructions of the device should be specified in the following formats.

-

PREPARE list12, imm5

-

PREPARE list12, imm5, sp/imm

-

DISPOSE imm5, list12

-

DISPOSE imm5, list12, [reg1]

 

-

In asrh, they need to be specified in the following formats.

-

prepare list, imm1

-

prepare list, imm1, imm2

-

prepare list, imm1, sp

-

dispose imm1, list

-

dispose imm1, list, [reg1]

 

-

list specifies the 12 registers that can be manipulated by the prepare or dispose 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:

 

[Example]

prepare r26, r29, r31, 0x10                 ; Same as "prepare 0x103, 0x10"

 

-

Specify the increased amount of sp by a multiple of four in imm1. The assembler shifts that value to the right by 2 bits and stores it in a machine instruction. The device will shift the value to the left by 2 bits prior to execution.

 

[Example]

To allocate 16 bytes of stack area, specify 0x10 instead of 0x4.

prepare 0, 0x10

 

-

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

Format

Result of Assembly

prepare list, imm1
prepare list, 0
movea   -imm1, sp, sp
prepare list, imm1, imm2
prepare list, 0, imm2
movea   -imm1, sp, sp
dispose imm1, list
movea   imm1, sp, sp
dispose  0, list
dispose imm1, list, [reg1]
movea   imm1, sp, sp
dispose  0, list, [reg1]

(b)

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

Format

Result of Assembly

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
dispose imm1, list, [reg1]
mov     imm1, r1
add     r1, sp
dispose  0, list, [reg1]
dispose imm1, list, [reg1]
mov     imm1, r1
add     r1, sp
dispose  0, list, [reg1]

[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 manipulated is specified for list, the assembler outputs the message shown below. Specification of that register is ignored in the generated code.

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 list 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).