Menu

Overlapped registers bug and possible fix

Help
2006-07-30
2013-05-28
  • Mike Nordell

    Mike Nordell - 2006-07-30

    In pentiumdecoder.cpp, 853, there is the comment for that code saying
    // Emit *8* r<8+off> := trunc(16, 8, r<off>)

    However, what that code emitted was actually
    Emit *8* r<off> := trunc(16, 8, r<off>)

    No wonder the output got crazy. :-)

    I did
    - Location::regOf(off),
    + Location::regOf(8+off),

    That seems like the correct thing to do, doesn't it?

     
    • Mike Nordell

      Mike Nordell - 2006-07-31

      Looking even more at this, isn't there some overlapped register handling missing?

      At least (e)si, (e)di and (e)bp seems to be absent, or are they not specially handled because they have no rl/rh equivalents?

       
      • Mike Van Emmerik

        Oops, complete oversight.

        - Mike

         
    • Mike Van Emmerik

      Yes, that would appear to be correct. Well spotted, as usual.

      - Mike