UD2
Usage: UD2 Modifies flags: None
Generates an invalid opcode. This instruction is provided for software testing to explicitly generate an invalid opcode. The opcode for this instruction is reserved for this purpose. Other than raising the invalid opcode exception, this instruction is the same as the NOP instruction.
Undefined Instruction
UD0 ; 0F FF [186,UNDOC]
UD1 ; 0F B9 [186,UNDOC]
UD2 ; 0F 0B [186]
UDx can be used to generate an invalid opcode exception, for testing purposes.(not implemented in RosAsm Assembler)
UD0 is specifically documented by AMD as being reserved for this purpose.(not implemented in RosAsm Assembler)
UD1 is documented by Intel as being available for this purpose.
UD2 is specifically documented by Intel as being reserved for this purpose. Intel document this as the preferred method of generating an invalid opcode exception.
All these opcodes can be used to generate invalid opcode exceptions on all currently available processors, but only UD2 is actually implemented in RosAsm assembler.
EXAMPLE:
ud2