"Alexei A. Frounze" <spamtrap@[EMAIL PROTECTED]
> wrote in message
news:69fe8af5-7c08-471a-a51c-4a6ae4cf0dde@[EMAIL PROTECTED]
> I didn't try the latest NDISASM, but the 0.98.35 that I have doesn't
> disassembly correctly this:
> db 0x82, 0xc0, 0x01 ; add Eb, Ib
> I get the following disassembly in 16-bit mode:
> 0000000C 82 db 0x82
> 0000000D C001B8 rol byte [bx+di],0xb8
>
> Interestingly, this seems to be exactly the same instruction
> (functionally) as this one:
> db 0x80, 0xc0, 0x01 ; add Eb, Ib
> for which I correctly get:
> 00000006 80C001 add al,0x1
>
> Even more interestingly, the AMD do***entation has both of these in
> table A-6 of volume 3. In there 82 /r is additionally marked as
> invalid in 64-bit mode. Whereas the intel do***entation is overly
> brief in its table A-6 of volume 2B.
> At the same time neither manual in the sections describing ADD/ADC/SUB/
> SBB/AND/OR/XOR/CMP lists the 82 /r encoding. Yet, the instructions
> with the 82 /r encoding work (in at least non-64-bit modes).
> Instructions to be deprecated? :)
>
> Any comments?
>
Not well known, but known. One of the AMD64 manuals obsoletes these for
64-bit mode:
inc, dec - single byte versions of are now REX prefixes
call far, jmp far
segments: ss, ds, es
push, pop of segments
lds, les
pusha, popa
into, bound
aaa, aad, aam, aas, daa, das
icebp
82h alias for 80h
sysenter, sy***it
arpl
salc
lahf, sahf (for some cpu's)
etc. (from chapter 2, "x86 and AMD 64 Architecture Differences" of "AMD64
Architecture Programmer's Manual Volume 2:System Programming" February,
2005)
If NASM sup****ted all undo***ented, all obsolete, or cpu specific
instructions (e.g. Cyrix or Katmai), it wouldn't be able to disassemble
the
current Intel and AMD instructions very well, IMO. You'd have to specify
which cpu you were disassembling for. How many cpu's do you want to try
to
get a good disassembly? 0x0F was POP CS on 8086's which is now the
two-byte
instruction prefix. You have the SAL alias for SHL. You have aliases for
TEST in 0xf6 and 0xf7. You have SALC. You have the undo***ented
instructions Robert Collins supposedly found (AAM variant, AAD variant,
many
UMOV's, LOADALL286, LOADALL386, ICEBP, SALC, CMOV, few FCMOV's, few
FCOMI's,
RDPMC, UD1, UD2, etc.). You have the obsolete XBTS and IBTS instructions
which are now CMPXCHG. You have the undo***ented FFREEP floating point
instruction.
> Any comments?
>
Chuck (or Frank) do you feel like implementing all that stuff? ;-) Did I
hear Alexei volunteer? ;-)
Rod Pemberton


|