diff --git a/internal/opcodesxml/opcodesxml.go b/internal/opcodesxml/opcodesxml.go index e2a4dd0..273b4e6 100644 --- a/internal/opcodesxml/opcodesxml.go +++ b/internal/opcodesxml/opcodesxml.go @@ -45,6 +45,7 @@ type Form struct { Operands []Operand `xml:"Operand"` ImplicitOperands []ImplicitOperand `xml:"ImplicitOperand"` ISA []ISA `xml:"ISA"` + Encoding Encoding `xml:"Encoding"` } type Operand struct { @@ -62,3 +63,45 @@ type ImplicitOperand struct { type ISA struct { ID string `xml:"id,attr"` } + +type Encoding struct { + REX *REX `xml:"REX"` + VEX *VEX `xml:"VEX"` + EVEX *EVEX `xml:"EVEX"` +} + +type REX struct { + Mandatory bool `xml:"mandatory,attr"` + W int `xml:"W,attr"` + R string `xml:"R,attr"` + X string `xml:"X,attr"` + B string `xml:"B,attr"` +} + +type VEX struct { + Type string `xml:"type,attr"` + W int `xml:"W,attr"` + L int `xml:"L,attr"` + M5 string `xml:"m-mmmm,attr"` + PP string `xml:"pp,attr"` + R string `xml:"R,attr"` + X string `xml:"X,attr"` + B string `xml:"B,attr"` + V4 string `xml:"vvvv,attr"` +} + +type EVEX struct { + M2 string `xml:"mm,attr"` + PP string `xml:"pp,attr"` + W int `xml:"W,attr"` + LL string `xml:"LL,attr"` + V4 string `xml:"vvvv,attr"` + V string `xml:"V,attr"` + RR string `xml:"RR,attr"` + B string `xml:"B,attr"` + X string `xml:"X,attr"` + Bsml string `xml:"b,attr"` + A3 string `xml:"aaa,attr"` + Z string `xml:"Z,attr"` + Disp8xN string `xml:"disp8xN,attr"` +} diff --git a/internal/opcodesxml/opcodesxml_test.go b/internal/opcodesxml/opcodesxml_test.go index 24a16c0..f3f8822 100644 --- a/internal/opcodesxml/opcodesxml_test.go +++ b/internal/opcodesxml/opcodesxml_test.go @@ -1,14 +1,12 @@ package opcodesxml import ( - "fmt" "testing" ) func TestReadFile(t *testing.T) { - is, err := ReadFile("testdata/x86_64.xml") + _, err := ReadFile("testdata/x86_64.xml") if err != nil { t.Fatal(err) } - fmt.Printf("%#v\n", is) }