Action Replay DS Codetypes

Code:
32bit write
0XXXXXXX YYYYYYYY - 32bit write of YYYYYYYY to location: XXXXXXXX + 'offset' 

16bit write
1XXXXXXX 0000YYYY - 16bit write of YYYY to location: XXXXXXXX + 'offset'

8bit write
2XXXXXXX 000000YY - 8bit write of YY to location: XXXXXXXX + 'offset'

32bit 'If less-than' instruction.
3XXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) < YYYYYYYY then execute the following block of instructions.
Conditional instructions can be nested.

32bit 'If greater-than' instruction.
4XXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) > YYYYYYYY then execute the following block of instructions.
Conditional instructions can be nested.

32bit 'If equal' instruction.
5XXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) == YYYYYYYY then execute the following block of instructions.
Conditional instructions can be nested.

32bit 'If not equal' instruction.
6XXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) != YYYYYYYY then execute the following block of instructions.
Conditional instructions can be nested.

16bit 'If less-than' instruction.
7XXXXXXX ZZZZYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) masked by ZZZZ < YYYY then execute the following block of instructions
Conditional instructions can be nested.

16bit 'If greater-than' instruction.
8XXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) masked by ZZZZ > YYYY then execute the following block of instructions.
Conditional instructions can be nested.

16bit 'If equal' instruction.
9XXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) masked by ZZZZ == YYYY then execute the following block of instructions.
Conditional instructions can be nested.

16bit 'If not equal' instruction.
AXXXXXXX YYYYYYYY - If the value at (XXXXXXXX or 'offset' when address is 0) masked by ZZZZ != YYYY then execute the following block of instructions.
Conditional instructions can be nested.

Load offset register.
BXXXXXXX 00000000 - Loads the offset register with the data at address (XXXXXXXX + 'offset')
Used to preform pointer relative operations.

Repeat operation.
C0000000 NNNNNNNN - repeats a block of codes for NNNNNNNN times. The block can include conditional instructions.
Repeat blocks cannot contain further repeats.

End-if instruction.
D0000000 00000000 - Ends the most recent conditional block.

End-repeat instruction.
D1000000 00000000 - Ends the current repeat block. Also implicitly ends any conditional instructions inside the repeat block.

End-code instruction.
D2000000 00000000 - Ends the current repeat block (if any), then End-if's any further outstanding conditional statements.
Also sets 'offset' and 'stored' to zero.

Set offset register.
D3000000 YYYYYYYY - Loads the offset register with the value YYYYYYYY.

Add to 'stored'.
D4000000 YYYYYYYY - Adds YYYYYYYY to the 'stored' register.

Set 'stored'.
D5000000 YYYYYYYY - Loads the value YYYYYYYY into the 'stored' register.

32bit store and increment.
D6000000 XXXXXXXX - Saves all 32 bits of 'stored' register to address (XXXXXXXX + 'offset'). Post-increments 'offset' by 4.

16bit store and increment.
D7000000 XXXXXXXX - Saves bottom 16 bits of 'stored' register to address (XXXXXXXX + 'offset'). Post-increments 'offset' by 2.

8bit store and increment.
D8000000 XXXXXXXX - Saves bottom 8 bits of 'stored' register to address (XXXXXXXX + 'offset'). Post-increments 'offset' by 1.

32bit load 'stored' from address.
D9000000 XXXXXXXX - Loads 'stored' with the 32bit value at address (XXXXXXXX + 'offset').

16bit load 'stored' from address.
DA000000 XXXXXXXX - Loads 'stored' with the 16bit value at address (XXXXXXXX + 'offset').

8bit load 'stored' from address.
DB000000 XXXXXXXX - Loads 'stored' with the 8bit value at address (XXXXXXXX + 'offset').

Add to 'offset'.
DC000000 YYYYYYYY - Adds YYYYYYYY to the 'offset' register .

Direct memory write.
EXXXXXXX NNNNNNNN - Writes NNNNNNNN bytes from the list of values VVVVVVVV to the addresses starting at (XXXXXXXX + 'offset').
VVVVVVVV VVVVVVVV *
((NNNNNNNN+7)/8)

Memory copy
FXXXXXXX NNNNNNNN - Copied NNNNNNNN bytes from addresses starting at the 'offset' register to addresses starting at XXXXXXXX.

Symbol Key
0000 - Values here don't matter
XXXX - Address
YYYY - Data
ZZZZ - Mask
NNNN - Count
VVVV - Direct Values
"Offset" - A code-engine register used to hold an address offset.
"Stored" - A code-engine register used to store data.
Source: Datel Trainer Toolkit User Manual