Table of contents

p6dis - Disassembler for Intel P6 Microcode

Overview

p6dis is a disassembler for Intel P6 family microcode. It processes microcode stored in triplet format (3 microoperations per line) and produces human-readable assembly-like output with labels, branch targets, and flow analysis.

Input Format

Input files are "hex triad" files (.tri) produced by p6scrambler -d. Each line represents one triad (3 microcode slots) at a specific address.

Command Line Options

Address Formats

Addresses can be specified as:

Flow Analysis Modes

Important notice: This set of functions is very very very very inefficient (and no, I am not paying your electricity bill). Someone should rewrite it, but it likely requires starting p6dis from scratch.

Forward Trace (-f)

Use case: "Show me all code paths starting from this entry point"

p6dis -t pentium2 -f 0x1000 input.tri

Marks and disassembles only microcode reachable by following branches forward from address 0x1000.

Backward Trace (-E)

Use case: "How did execution reach this point?"

p6dis -t pentium2 -E 0x2000 input.tri

Marks and disassembles only microcode that can lead to address 0x2000 by tracing predecessors backward.

Complete Flow Trace (-e)

Use case: "Show me all possible execution paths that could end at this point, including their side branches"

p6dis -t pentium2 -e 0x2000 input.tri

Two-phase analysis:

This is extremely useful for finding all code branches that may terminate at a specific point.

Label Files

Label file format (.lbl):

 
# Comments start with #
1234 entry_point
5678 error_handler

Load with: [email protected]

Constant ROM Files

Constant ROM files (.cst) define microcode constant values referenced as CONSTROM.XXX (alias 0x0C) or CONSTROM2.XXX (alias 0x18) in disassembly output.

Format:

index: hexvalue

# Comments start with #

000: FFFFFFFFFFFFFE40
001: 0000000000000001
0EE: DEADBEEF12345678

Load with: -C constants.cst

When loaded, disassembly will show:

TMP5 = LOAD.SC1.DSZ8 (TMP0, TMP7, CONSTROM.0EE /* 0xDEADBEEF12345678 / -2401053092306725256 */, ...)

Floating Point ROM (fprom) Files

fprom files define the microcode floating-point constant ROM, shown as an inline comment after a plain CONST.. operand whenever that operand belongs to an fprom instruction. Unlike CONSTROM, there's no dedicated CONST_FP-style mnemonic - the fprom lookup just decorates whatever CONST.XX.XXX operand the instruction already prints.

Format is identical to the constant ROM file's "IDX: VALUE" format (see above) - same loader, same index range (000-1FF), values up to 32 hex digits:

002: 5555555555555584F
12F: 02952286C65746E49

Load with: -F fprom.cst

Each fprom entry can hold either a float-ish payload or a short ASCII string packed into the low 32 or 64 bits (used for e.g. the "Intel(R)..." CPU brand string baked into some ROMs); p6dis tries the ASCII interpretation first and only shows it when the bytes are actually printable:

TMPx = MOVE (CONST.0B.12F /* 0x2952286C65746E49 / 0 / 'Intel(R)' */, ...)

Known issue: the "floatpoint" value is currently computed assuming a classic 80-bit x87 extended layout (64-bit mantissa / 15-bit exponent / sign), which is a placeholder, not confirmed hardware fact. Reverse-engineering of a separate raw ROM readout (which exposes the exponent as its own ~20-bit field alongside the mantissa, rather than packed into a fixed 80-bit word) suggests the real fprom entries are wider than 80 bits and use a biased exponent (bias 0x10041 observed empirically) over a mantissa wider than 64 bits - none of that is wired into p6dis's float decode yet, so treat the printed floatpoint value with suspicion until this is revisited. A small helper tool, readconst2_to_fprom, exists to pack that raw ROM readout format into an -F-loadable file without doing any (potentially wrong) float interpretation itself.

Common Usage Patterns

Basic Disassembly

p6scrambler -d -t pentium2 msrom.hex | p6dis -t pentium2 -

With Labels

p6scrambler -d -t pentium2 msrom.hex | p6dis -t pentium2 [email protected] -

Trace From Entry Point

p6dis -t pentiumpro [email protected] -f entry_point input.tri > output.asm

Advanced: Backtrace All EOM Flow Markers

This pipeline generates complete backtraces for every End-Of-Microcode (EOM) flow marker:

p6scrambler -d -t pentiumpro msrom.hex | \
p6dis -t pentiumpro - | \
grep EOM | cut -c 6-9 | \
while read addr ; do
# Full backtrace (backward only)
p6scrambler -d -t pentiumpro msrom.hex | \
p6dis -t pentiumpro [email protected] - -E 0x$addr > full/$addr.full.asm

# Complete flow (backward + forward from all predecessors)
p6scrambler -d -t pentiumpro msrom.hex | \
p6dis -t pentiumpro [email protected] - -e 0x$addr > full/$addr.back.asm

echo $addr
done

Explanation:

./p6microcode-tools/p6scrambler -dt pentiumpro msrom-612.hex  | ./p6microcode-tools/p6dis -t pentiumpro - | grep EOM | cut -c 6-9 | while read addr ; do ./p6microcode-tools/p6scrambler -dt pentiumpro msrom-612.hex  | ./p6microcode-tools/p6dis -t pentiumpro -L @msrom-612.lbl  - -E 0x$addr > full/msrom-612-$addr.full.asm ; ./p6microcode-tools/p6scrambler -dt pentiumpro msrom-612.hex  | ./p6microcode-tools/p6dis -t pentiumpro -L @msrom-612.lbl - -e 0x$addr > full/msrom-612-$addr.back.asm ; echo $addr ; done
This project is an independent, unofficial work based on publicly available information and reverse-engineering research, and is not affiliated with, endorsed by, sponsored by, or associated with Intel Corporation or its affiliates. It is provided "as is", without warranty of any kind. The author assumes no responsibility or liability for any use, misuse, damage, data loss, hardware failure, or other consequences arising from its use. Intel, Pentium, Core and related trademarks are the property of their respective owners and are used solely for identification and informational purposes.
  • index page
  • uop description
  • ADC
  • ADD
  • AND
  • BSF
  • BSR
  • BSWAP
  • BTEST
  • DIV
  • FANDNOT
  • FCALCTW
  • FCMOV
  • FCOM
  • FMERGE
  • FMOV
  • FPEXTRACT
  • FPORDATATYPE
  • FPSIGNEXT
  • FREADROM
  • FXORS
  • IDIV
  • IMUL
  • INTEXTRACT
  • LEA
  • LOAD
  • MOVE
  • MOVEFROMCREG
  • MOVETOCREG
  • MUL
  • OR
  • PORTIN
  • PORTOUT
  • RCL
  • RCR
  • RDSEGFLD
  • ROL
  • ROR
  • SAL
  • SAR
  • SBC
  • SHL
  • SHR
  • SIGEVENT
  • STA
  • STRD
  • SUB
  • SUBR
  • TRANSPORTUIP
  • UOP
  • U_JCC
  • U_JMP
  • U_JMP_INDIR
  • WRSEGFLD
  • WUCONCAT
  • WUEXTRBK
  • WUINSERT
  • WUMERGE
  • XOR