1------ empty input
2====
3[]
4
5------ only newlines
6
7
8
9====
10[]
11
12------ only comments and newlines
13# {
14# ICLASS : ADD
15# }
16====
17[]
18
19------ join lines
20{
21ICLASS : i\
22 cla\
23 ss1
24VERSION : 1.\
250
26FLAGS:\
27\
28\
29NOP
30
31REAL_OPCODE : \Y
32CPL : \3
33PATTERN: A B
34OPERANDS:
35}
36====
37[{
38 "Iclass": "i cla ss1",
39 "Version": "1.0",
40 "Flags": "NOP",
41 "RealOpcode": "\\Y",
42 "CPL": "\\3",
43 "Pattern": "A B"
44}]
45
46------ 1 variant; no iform
47{
48ICLASS:iclass1 # comment
49DISASM : disasm1
50
51PATTERN :pat1 pat1
52OPERANDS : ops1 ops1
53}
54# comment
55
56{ # comment
57# comment
58ICLASS : iclass2
59OPERANDS:ops2
60PATTERN:pat2 # comment
61}
62====
63[{
64 "Iclass": "iclass1",
65 "Disasm": "disasm1",
66 "Pattern": "pat1 pat1",
67 "Operands": "ops1 ops1"
68}, {
69 "Iclass": "iclass2",
70 "Operands": "ops2",
71 "Pattern": "pat2"
72}]
73
74------ 2 variants; no iform
75{
76PATTERN : pat1_1
77COMMENT : comment1
78OPERANDS : ops1_1
79OPERANDS : ops1_2
80PATTERN : pat1_2
81}
82{
83PATTERN : pat2_1
84PATTERN : pat2_2
85OPERANDS : ops2_1
86OPERANDS : ops2_2
87}
88====
89[{
90 "Comment": "comment1",
91 "Pattern": "pat1_1",
92 "Operands": "ops1_1"
93}, {
94 "Comment": "comment1",
95 "Pattern": "pat1_2",
96 "Operands": "ops1_2"
97}, {
98 "Pattern": "pat2_1",
99 "Operands": "ops2_1"
100}, {
101 "Pattern": "pat2_2",
102 "Operands": "ops2_2"
103}]
104
105------ 3 variants
106{
107
108PATTERN : pat1_1
109OPERANDS : ops1_1
110IFORM : iform1_1
111
112PATTERN : pat1_2# comment
113OPERANDS : ops1_2# comment
114IFORM : iform1_2# comment
115
116# comment
117PATTERN : pat1_3
118OPERANDS : ops1_3
119IFORM : iform1_3
120
121}
122
123{
124PATTERN : pat2_1
125OPERANDS : ops2_1
126IFORM : iform2_1
127PATTERN : pat2_2
128OPERANDS : ops2_2
129PATTERN : pat2_3
130OPERANDS : ops2_3
131}
132====
133[{
134 "Iform": "iform1_1",
135 "Pattern": "pat1_1",
136 "Operands": "ops1_1"
137}, {
138 "Iform": "iform1_2",
139 "Pattern": "pat1_2",
140 "Operands": "ops1_2"
141}, {
142 "Iform": "iform1_3",
143 "Pattern": "pat1_3",
144 "Operands": "ops1_3"
145}, {
146 "Iform": "iform2_1",
147 "Pattern": "pat2_1",
148 "Operands": "ops2_1"
149}, {
150 "Pattern": "pat2_2",
151 "Operands": "ops2_2"
152}, {
153 "Pattern": "pat2_3",
154 "Operands": "ops2_3"
155}]
156
157------ stable and unstable instructions (REAL_OPCODE)
158{
159ICLASS: STABLE
160REAL_OPCODE: Y
161PATTERN : x y z
162OPERANDS :
163}
164{
165ICLASS: UNSTABLE
166REAL_OPCODE: N
167PATTERN : x y z
168OPERANDS :
169}
170====
171[{
172 "Iclass": "STABLE",
173 "RealOpcode": "Y",
174 "Pattern": "x y z",
175 "Operands": ""
176}, {
177 "Iclass": "UNSTABLE",
178 "RealOpcode": "N",
179 "Pattern": "x y z",
180 "Operands": ""
181}]
182
183------ AVXAES objects
184# Emitting VAESENCLAST
185{
186ICLASS : VAESENCLAST
187EXCEPTIONS: avx-type-4
188CPL : 3
189CATEGORY : AES
190EXTENSION : AVXAES
191PATTERN : VV1 0xDD V66 V0F38 MOD[0b11] MOD=3 REG[rrr] RM[nnn] VL128
192OPERANDS : REG0=XMM_R():w:dq REG1=XMM_N():r:dq REG2=XMM_B():r:dq
193PATTERN : VV1 0xDD V66 V0F38 MOD[mm] MOD!=3 REG[rrr] RM[nnn] MODRM() VL128
194OPERANDS : REG0=XMM_R():w:dq REG1=XMM_N():r:dq MEM0:r:dq
195}
196# Emitting VAESDEC
197{
198ICLASS : VAESDEC
199EXCEPTIONS: avx-type-4
200CPL : 3
201CATEGORY : AES
202EXTENSION : AVXAES
203PATTERN : VV1 0xDE V66 V0F38 MOD[0b11] MOD=3 REG[rrr] RM[nnn] VL128
204OPERANDS : REG0=XMM_R():w:dq REG1=XMM_N():r:dq REG2=XMM_B():r:dq
205PATTERN : VV1 0xDE V66 V0F38 MOD[mm] MOD!=3 REG[rrr] RM[nnn] MODRM() VL128
206OPERANDS : REG0=XMM_R():w:dq REG1=XMM_N():r:dq MEM0:r:dq
207}
208====
209[{
210 "Iclass": "VAESENCLAST",
211 "Exceptions": "avx-type-4",
212 "CPL": "3",
213 "Category": "AES",
214 "Extension": "AVXAES",
215 "Pattern": "VV1 0xDD V66 V0F38 MOD[0b11] MOD=3 REG[rrr] RM[nnn] VL128",
216 "Operands": "REG0=XMM_R():w:dq REG1=XMM_N():r:dq REG2=XMM_B():r:dq"
217}, {
218 "Iclass": "VAESENCLAST",
219 "Exceptions": "avx-type-4",
220 "CPL": "3",
221 "Category": "AES",
222 "Extension": "AVXAES",
223 "Pattern": "VV1 0xDD V66 V0F38 MOD[mm] MOD!=3 REG[rrr] RM[nnn] MODRM() VL128",
224 "Operands": "REG0=XMM_R():w:dq REG1=XMM_N():r:dq MEM0:r:dq"
225}, {
226 "Iclass": "VAESDEC",
227 "Exceptions": "avx-type-4",
228 "CPL": "3",
229 "Category": "AES",
230 "Extension": "AVXAES",
231 "Pattern": "VV1 0xDE V66 V0F38 MOD[0b11] MOD=3 REG[rrr] RM[nnn] VL128",
232 "Operands": "REG0=XMM_R():w:dq REG1=XMM_N():r:dq REG2=XMM_B():r:dq"
233}, {
234 "Iclass": "VAESDEC",
235 "Exceptions": "avx-type-4",
236 "CPL": "3",
237 "Category": "AES",
238 "Extension": "AVXAES",
239 "Pattern": "VV1 0xDE V66 V0F38 MOD[mm] MOD!=3 REG[rrr] RM[nnn] MODRM() VL128",
240 "Operands": "REG0=XMM_R():w:dq REG1=XMM_N():r:dq MEM0:r:dq"
241}]
242
243------ Two-word disasm
244{
245ICLASS : JMP_FAR
246DISASM_INTEL: jmp far
247DISASM_ATTSV: ljmp
248CPL : 3
249CATEGORY : UNCOND_BR
250ATTRIBUTES : FAR_XFER NOTSX
251EXTENSION : BASE
252ISA_SET : I86
253PATTERN : 0xEA not64 BRDISPz() UIMM16()
254OPERANDS : PTR:r:p IMM0:r:w REG0=XED_REG_EIP:w:SUPP
255}
256====
257[{
258 "Iclass": "JMP_FAR",
259 "DisasmIntel": "jmp far",
260 "DisasmATTSV": "ljmp",
261 "CPL": "3",
262 "Attributes": "FAR_XFER NOTSX",
263 "Extension": "BASE",
264 "ISASet": "I86",
265 "Pattern": "0xEA not64 BRDISPz() UIMM16()",
266 "Operands": "PTR:r:p IMM0:r:w REG0=XED_REG_EIP:w:SUPP"
267}]
268
269------ INVALID key token
270{
271FOO : 111
272}
273====
274unknown key token: FOO
275
276------ INVALID unterminated object
277{
278====
279no matching '}' found
280
281------ INVALID pat+ops
282{
283ICLASS: foobar
284PATTERN : 1
285PATTERN : 2
286OPERANDS : 3
287}
288====
289foobar: OPERANDS and PATTERN lines mismatch
View as plain text