Comments (2)
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
:
flexdis86/src/Flexdis86/Assembler.hs
Line 235 in 6d6e8c3
However, oso
is False
here because of this line:
flexdis86/src/Flexdis86/Assembler.hs
Lines 86 to 88 in 6d6e8c3
Ugh. I guess this means we'll need to infer the presence of oso
like we do for REX
?
from flexdis86.
Fixed in #37.
from flexdis86.
Related Issues (16)
- Problem disassembling `fldt` instruction HOT 1
- Add support for endbr64 and endbr32
- GHC 8.8 support HOT 1
- defaultX64Disassembler should run mkX64Disassembler at compile time HOT 2
- Regression during ghc-8.8 update
- movslq instruction fails roundtrip tests HOT 1
- mov instruction fails roundtrip test HOT 2
- Roundtrip .text sections of sample binaries
- `utils/dump.sh`: Add option to accept AT&T syntax
- Move `binary-symbols` to another repo HOT 3
- The generated parse table consumes too much memory HOT 12
- `flexdis86` gives incorrect size to `xchg ax,ax`'s operands
- Support `notrack` prefixes HOT 1
- The `getPathToOptableXML` trick does not work in HLS
- Deprecate or remove NDS/DDS/NDS? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexdis86.