Thursday, December 30, 2010

x86 encoding

Dammit, x86. There are FPU escape codes, 1-byte, 2-bytes and 3-bytes opcodes, prefixes to specify which command does specific opcode refer to, sometimes this define a group of commands and specific command is determined using reg/opc field in ModR/M byte (so these are only instructions with one argument or those which have an immediate as a second argument), but this isn't an end: since first argument can refer either to memory or to register some commands sharing the same opcode and reg/opc are distinguished using this information (mod field of ModR/M). And the hell is there are two pairs of operations in a regular opcodes tables which one can separate only by the type (memory or register) of the second argument:

0x0f 0x12  movlps VqMq   or  movhlps VqUq
0x0f 0x16  movhps VqMq   or  movlhps VqUq

No comments:

Post a Comment