Re: announce: my very first disassembler now available (GPL)



On Aug 16, 8:59 pm, Willow <wrschlan...@xxxxxxxxx> wrote:
The latest version is here:http://code.google.com/p/vm64dec/downloads/list

I think those size problems are fixed now. Here is a list of known
erratta:

1. It never prints "near". This is the default so it shouldn't matter.
2. aad, aam have an argument. This is actually valid.
3. xchg needs to be turned into nop when applicable. Need to do this!

There's also a special case in 64-bit mode. Depending on the rex
prefix (AFAIR, bit B) it can be either NOP or XCHG.

4. Need to add support for extended opcodes such as 'd9 f4' (fxtract)
and '66 0f 38 01' (phaddw). How to do this? Do any extended opcodes
have a modr/m? Can we pretend the opcode byte is an immediate byte?

Normally, almost every instruction that has mod<3 has a memory operand
(some exceptions: 3dNow! instructions have a dummy memory operand (as
well as some multibyte NOP instructions) and MOV CR/DR according to
the documentation ignore mod). Instructions that have an opcode
extension in the reg field (denoted as /number) can have the following
operands according to the ModR/M byte value (there may be implicit,
non-ModR/M ones, too):
- register AND register/memory, e.g. ADD
- memory AND register, e.g. BOUND
- memory OR register, e.g. LTR
- memory only, e.g. XRSTOR
- none, e.g. LFENCE, VMCALL

FPU instructions are generally encoded the same way as non-FPU
instructions if there's a memory operand (i.e. mod<3). The same is
often true about FPU instructions that don't have a memory operand,
but not always. E.g. there's FSTSW AX that seems to be valid/existent
only for AX and the r/m field often denotes not some register but a
particular instruction (i.e. further extends the opcode), e.g. F2XM1
through FCOS.

Alex
.



Relevant Pages

  • Re: Rational behind removing register forms of inc, dec?
    ... Anyone know what the rational behind removing the register forms of inc, ... instructions, one would start with the memory modes since a mov or lea could ... And yes, even with the obsolete instructions they eliminated, the ... opcode space is still pretty dense. ...
    (alt.lang.asm)
  • Re: announce: my very first disassembler now available (GPL)
    ... instructions if there's a memory operand. ... particular instruction (i.e. further extends the opcode), ... I didn't have any handling in my table format for 2- ...
    (alt.lang.asm)
  • Re: i386/x86_64 segment register issuses (Re: PATCH: Fix x86 segment register access)
    ... > The new assembler will disallow them since those instructions with ... > memory operand will only use the first 16bits. ... why their kernel does not compile anymore. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Optimization Questions
    ... cycles you'd save would be more than offset by the cycles you'd burn ... instructions go through port 0 and port 1. ... a 16-bit register, writing one afterwards will be fast. ... Pre-read the value in EAX ...
    (comp.lang.asm.x86)
  • Re: Kind of new: function implementation questions, MASM
    ... >sub esp, varsize ... >select which of the local variables to copy into the working register, ... If you have 512kB of 8-way associative cache, ... You probably shouldn't use the prefetch instructions at all. ...
    (comp.lang.asm.x86)