I was making a small x86 assembler once and I was frustrated that the encoding seemed almost random and very hard to generate. Until I fell over a comment in some google group stating that the key to understanding it is that all opcodes are coded in octal. It's inherited all the way back from the 8080, but for some reason this information was nowhere to be found, including the official references from Intel that I had.