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 (-B)

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

p6dis -t pentium2 -B 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 in disassembly output.

Format:

: <64-bit hex value>
# 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 / ... */, ...)

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] -B 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