5 ms·
I apologize if this is a naive question but how do I make sense of microcode_8086.txt in the zip file? Just using line 1 or 000. I understand from the final col
by bogomipz 6y ago
I apologize if this is a naive question but how do I make sense of microcode_8086.txt in the zip file? Just using line 1 or 000. I understand from the final column(s) that this concerns a MOV instruction and Mod R/M byte is that correct? How do I understand what everything to the left of that means?
000 A CD F H J L OPQR U R -> tmpb 4 none WB,NX 0100010??.00 MOV rm<->r
Similarly how do I understand what each of the different files in the zip file represents?
The authors states:
>"I used bitract to extract the bits from the two main microcode ROMs, and also from the translation ROM which maps opcode bit patterns onto positions within the main microcode ROM."
Is the the translation ROM the translation.txt file then? Is that the key to understanding these files? If so why wouldn't there be more than the 38 or so Op codes listed?
- ajenner 6y agoThe translation.txt file is the contents of the translation ROM which tells the CPU where in the microcode to go for long jumps, calls and EA decoding. The key.txt file has the details of all the mnemonics. "000" - this is just a line number "A CD F H J L OPQR U" - these are the actual bits from the ROM. "R -> tmpb" - this is a move operation (each microcode instruction can do a move as well as something else) copying the value from "R" (a register described by the word length bit and either the R field or the RM field of the modrm byte depending on the direction bit) to "tmpb" (an internal register not accessible from the user-level ISA). "4 none WB,NX" - a type 4 instruction (bookkeeping) that tells the CPU that the next instruction is the last one in the microcode burst (NX) unless a write back (WB) to memory is needed. "0100010??.00" - this is the bit pattern by which this line of microcode is addressed. This one means opcodes 0x88-0x8b. "MOV rm<->r" - a comment added to say what this set of opcodes actually corresponds to x86 assembler, or what it does if it's a subroutine.
- bogomipz 6y agoThank you this really helps. One last question do the individual files. There seems to be 3 distinct file groups: 0b.txt - 8t.txt l0.txt - l3.txt r0.txt-r3.txt Do each of these represent different ROMs or different logical parts of the two ROMs? Or am I reading too much into the naming convention? By the way - brilliant work. This is really a fascinating read.
- ajenner 6y agoThe b and t files are the bottom and top halves of the 9 "chunks" of the decoder above the main microcode ROM. The l* and r* files are the left and right halves of the four horizontal slices of the main ROM. I split them up that way because bitract needs the bits to be regularly spaced in both the horizontal and vertical directions. Thanks - glad you enjoyed it!