Giter VIP home page Giter VIP logo

Comments (2)

RyanGlScott avatar RyanGlScott commented on July 26, 2024

I thought that this would suffice to handle the cases for immediates:

diff --git a/data/optable.xml b/data/optable.xml
index 7d02fba..c5facfc 100644
--- a/data/optable.xml
+++ b/data/optable.xml
@@ -6982,7 +6982,7 @@
         <def>
             <pfx>oso</pfx>
             <opc>68</opc>
-            <opr>Iz</opr>
+            <opr>sIz</opr>
             <mode>def64</mode>
         </def>
         <def>
@@ -6994,7 +6994,7 @@
         <def>
             <pfx>oso</pfx>
             <opc>6a</opc>
-            <opr>Ib</opr>
+            <opr>sIb</opr>
             <mode>def64</mode>
         </def>
     </instruction>
diff --git a/tests/Assemble.hs b/tests/Assemble.hs
index ace04f5..e5a2179 100644
--- a/tests/Assemble.hs
+++ b/tests/Assemble.hs
@@ -31,9 +31,9 @@ j20 = [D.JumpOffset D.JSize8 (D.FixedOffset (20 - 2))]
 testCases :: [(AsmFlavor, String, Maybe D.InstructionInstance)]
 testCases = [ (Att, "ret", mkI "ret" [])
             , (Att, "int $0x3", mkI "int3" [])
-            , (Att, "push $0x8", mkI "push" [D.ByteImm 8])
-            , (Att, "pushw $0xfff", fmap setOSO $ mkI "push" [D.WordImm 0xfff])
-            , (Att, "push $0x2000000", mkI "push" [D.DWordImm (D.Imm32Concrete 0x2000000)])
+            , (Att, "push $0x8", mkI "push" [D.ByteSignedImm 8])
+            , (Att, "pushw $0xfff", fmap setOSO $ mkI "push" [D.WordSignedImm 0xfff])
+            , (Att, "push $0x2000000", mkI "push" [D.DWordSignedImm 0x2000000])
               -- The subtraction here is gross, but required because
               -- the jump is relative to the IP, which is incremented
               -- past the jump by the time it executes.

However, that causes the (Att, "pushw $0xfff", fmap setOSO $ mkI "push" [D.WordSignedImm 0xfff]) test case to fail. Some investigation reveals that this is because matchOperandType returns False. Ideally, we would hit this case of matchOperandType:

(WordSignedImm _, IM_SZ) | oso == True -> True

However, oso is False here because of this line:

-- Always only consider case where operand size override is false.
-- NOTE. We could extend this to consider both options.
let oso = False

Ugh. I guess this means we'll need to infer the presence of oso like we do for REX?

from flexdis86.

RyanGlScott avatar RyanGlScott commented on July 26, 2024

Fixed in #37.

from flexdis86.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.