x86: Better disassembly of segment-prefixes.
authorLutz Euler <lutz.euler@freenet.de>
Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)
committerLutz Euler <lutz.euler@freenet.de>
Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)
commitde6d4c2fc663eb1caeb6b4fd114866413fb56a41
tree6efebe617947a2433a6440cb03308a281fce6dd0
parent65bdee4ba534e82c352cff3eec16473daaf285dd
x86: Better disassembly of segment-prefixes.

Thanks to Alastair Bridgewater who originally provided these changes
(and the headline above). I adapted his work to fit into the prefix
instruction infrastructure now available. Of his original comments
the following three still apply:

  * Establish a SEG prefix for segment overrides similar
to the X66 data-width prefix.

  * Have the SEG prefilter set an instruction property
for the specific segment being used.

  * Alter PRINT-MEM-ACCESS to output a suitable prefix
for memory addresses when the appropriate instruction
property has been set.

I have abstracted out the segment prefix printing into the new function
MAYBE-PRINT-SEGMENT-OVERRIDE, called from PRINT-MEM-ACCESS, not to make
the latter more lengthy.

Here is an example to show the difference in disassembler output:

Old:

;      0E6:       64               FS-SEGMENT-PREFIX
;      0E7:       8910             MOV [EAX], EDX
;      0E9:       64               FS-SEGMENT-PREFIX
;      0EA:       8B0528000000     MOV EAX, [#x28]

New:

;      0E6:       648910           MOV FS:[EAX], EDX
;      0E9:       648B0528000000   MOV EAX, FS:[#x28]
NEWS
src/compiler/x86/insts.lisp
src/compiler/x86/target-insts.lisp