2.6.4.1 Edit instructions

Follow the steps below to edit instructions.

(1)

Switch to edit mode

Double-click the instruction to edit or select [Edit Disassemble] from the context menu after moving the caret to the instruction to edit.

(2)

Edit instructions

Use keyboard to directly edit the instructions.

(3)

Write to memory

Press the [Enter] key to line assemble the edited instructions after editing. The code is automatically written to the memory.

If the edited instruction is invalid, the instruction is shown in red and will not be written to the memory.

 

If there is a space because of overwriting the displayed result of disassembling by another instruction, its byte number is automatically compensated with nop instruction as follows:

Example 1.

Overwriting the prepare instruction (8-byte instruction) with the jarl instruction (4-byte instruction)

Before editing

0432                mov     0x4, r6
1d38                mov     r29, r7
8f071b0effff0000    prepare r20, r21, r22, 0x1c, 0x0000ffff
0132                mov     0x1, r6

After editing

0432                mov     0x4, r6
1d38                mov     r29, r7
bfffe265            jarl    0x100, lp
0000                nop
0000                nop
0132                mov     0x1, r6

Example 2.

Overwriting the mov instruction (2-byte instruction) with the jarl instruction (4-byte instruction)

Before editing

0432                mov     0x4, r6
1d38                mov     r29, r7
8f071b0effff0000    prepare r20, r21, r22, 0x1c, 0x0000ffff
0132                mov     0x1, r6

After editing

0432                mov     0x4, r6
bfffe265            jarl    0x100, lp
0000                nop
0000                nop
0000                nop
0132                mov     0x1, r6

Caution

Handling the prepare instruction and dispose instruction
The following table shows the instruction formats of the prepare instruction and dispose instruction. The operand "list12" comprises 12-bit value where a different register is assigned to each bit.

Instruction format of the prepare instruction

prepare     list12, imm5
prepare     list12, imm5, sp/imm

Instruction format of the dispose instruction

dispose     imm5, list12
dispose     imm5, list12, [reg1]

When displaying the results of disassembling the prepare instruction and dispose instruction in the Disassemble panel, the corresponding register names for the operand "list12" are displayed instead of its values as shown in the following examples.

Example 1.

When the code is "0xbf, 0x07, 0xe1, 0xff" (4-byte prepare instruction)

View

prepare   r20, r21, r22, r23, r24, r25, r26, r27,r28, r29, r30, r31, 0x20

Syntax

prepare   0xfff, 0x20

Example 2.

When the code is "0x90, 0x07, 0xbb, 0xaa 0xff, 0xff, 0xff, 0xff" (8-byte prepare instruction)

View

prepare   r20, r22, r24, r26, r28, r31, 0x20, 0x7fffffff

Syntax

prepare   0x555, 0x20, 0x7fffffff

Example 3.

When the code is "0x51, 0x06, 0xe0, 0xff" (4-byte dispose instruction)

View

dispose   0x20, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31

Syntax

dispose   0x20, 0xfff

Example 4.

When the code is "0x50, 0x06, 0xaa, 0xaa" (4-byte dispose instruction)

View

dispose   0x20, r20, r22, r24, r26, r28, r31, [r10]

Syntax

dispose   0x20, 0x555, [r10]

 

Note, however, that it is possible to specify both the value and the register name for the operand "list12" when line assembling the prepare instruction and dispose instruction.

Example 5.

In both of the cases (1) and (2) below, the same set of values "0x91, 0x07, 0xe1, 0xff" will be generated as a result of line assembly.

(1)

prepare   r20, r21, r22, r23, r24, r25, r26, r27,r28, r29, r30, r31, 0x20

(2)

prepare   0xfff, 0x20

Example 6.

In both of the cases (1) and (2) below, the same set of values "0xbe, 0x07, 0xbb, 0xaa 0xff, 0xff, 0xff, 0x7f" will be generated as a result of line assembly.

(1)

prepare   r20, r22, r24, r26, r28, r31, 0x20, 0x7fffffff

(2)

prepare   0x555, 0x20, 0x7fffffff

Example 7.

In both of the cases (1) and (2) below, the same set of values "0x51, 0x06, 0xe0, 0xff" will be generated as a result of line assembly.

(1)

dispose   0x20, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31

(2)

dispose   0x20, 0xfff

Example 8.

In both of the cases (1) and (2) below, the same set of values "0x50, 0x06, 0xaa, 0xaa" will be generated as a result of line assembly.

(1)

dispose   0x20, r20, r22, r24, r26, r28, [r10]

(2)

dispose   0x20, 0x555, [r10]