Modifiers are appended to the end of an opcode to modify the opcode's behaviour.
This allows for each opcode to have a wide range of behaviours (up to 7) without the need to introduce multiple variants of each opcode. Modifiers were introduced in the ICWS'94 standard. In earlier standards, the modifier was implied by the opcode. To allow backwards compatibility, each opcode has a default modifier which is inserted by the Parser if necessary.
modifiers can be used in Corewar
When an instruction is executed, the modifier controls which values from the source and destination instruction are used as follows:
|.a||A operand||A operand|
|.b||B operand||B operand|
|.ab||A operand||B operand|
|.ba||B operand||A operand|
|.f||A and B operands||A and B operands|
|.x||A and B operands||B and A operands|
|.i||Whole instruction||Whole instruction|
For most opcodes the
.i modifier has the same effect as the
The specified opcode is applied to the entire source and destination instructions. The
.i modifier is only applicable to the mov, seq and sne opcodes. Other opcodes tend to default to the behaviour of the .f modifier.