Interesting.
I went through the entire instruction set, starting with the 8086 and moving all the way up to the 80386, defining all of the instructions in a name/value pair in XML, and I've used that XML file to generate XSLT transforms to convert these names into their hex values. I definitely notice some of these repeating patterns when creating these XML enumerations, but a) they didn't seem quite stable enough to rely on (for instance, one value occasionally would not be needed, and would be replaced with something completely unrelated), and b) knowing these patterns wasn't terribly helpful, as defining 255 instructions at a time was easier than trying to break them up into 8-instruction chunks (ADD, ADC, SUB, SBB, CMP, OR, AND, XOR), and then ORing those values with 9 operand values (Eb-Rb, Ew-Rw, Rb-Eb, Rw-Ew, AL-Db, AX-Dw, Eb-Db, Ew-Dw, Ew-Dc).
I just decided to create one set of 255 values for the first byte, and then several sets of 255 values for the second byte, and so on.
<cpu:CopyRegisterToOperand/> <op:AX-DIAddress/>
But I'd be interested if someone could figure out how to use the octal values to simplify this approach.
_________________ Project: OZone Source: GitHub Current Task: LIB/OBJ file support "The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
|