1 | for X = [ADD, OR, ADC, SBB, AND, SUB, XOR, CMP, TEST] do
2 | let RRW = $((X=="CMP" or X=="TEST") and "r" or "rw")
3 | let FRW = $((X=="ADC" or X=="SBB") and "rw" or "w")
4 | let BYTE = $(X~="TEST" and "<byte>")
5 | for Y = [8, 16, 32, 64, DEF] do
6 $(X86(Y)) $(X){_M$(RSZ(Y))} [RAX], $(RNAME("RCX", Y)) {|RAX/r,RCX/r,FLAGS/$(FRW)}
7 $(X86(Y)) $(X){_$(RSZ(Y))$(RSZ(Y))} $(RNAME("RCX", Y)), $(RNAME("RDX", Y)) {|RCX/$(RRW),RDX/r,FLAGS/$(FRW)}
8 $(X86(Y)) $(X){_$(RSZ(Y))M} $(RNAME("RCX", Y)), [RAX] {|RCX/$(RRW),RAX/r,FLAGS/$(FRW)}
10 $(X){_BI} CL, 1 {|RCX/$(RRW),FLAGS/$(FRW)}
11 $(X){_M8I} <byte> [RAX], 1 {|RAX/r,FLAGS/$(FRW)}
12 | for Y = [16, 32, 64, DEF] do
13 $(X86(Y)) $(X){_$(RSZ(Y))I} $(RNAME("RCX",Y)), $(BYTE) 1 {|RCX/$(RRW),FLAGS/$(FRW)}
14 $(X86(Y)) $(X){_$(RSZ(Y))I} $(RNAME("RCX",Y)), 0x100 {|RCX/$(RRW),FLAGS/$(FRW)}
15 $(X86(Y)) $(X){_M$(MSZ(Y))I} <$(NASMSZ(Y))> [RAX], $(BYTE) 1 {|RAX/r,FLAGS/$(FRW)}
16 $(X86(Y)) $(X){_M$(MSZ(Y))I} <$(NASMSZ(Y))> [RAX], 0x100 {|RAX/r,FLAGS/$(FRW)}
19 | for X = [ADD, OR, ADC, SBB, AND, SUB, XOR, CMP] do
20 | for Y = [8, 16, 32, 64, DEF] do
21 $(X86(Y)) $(X){_$(RNAME("RAX",Y))_I} <$(RNAME("RAX", Y)),> $(RCONST(0x12345678, Y)) {|RAX/$(RRW),FLAGS/$(FRW)}
25 | for X = [INC, DEC, NOT, NEG, DIV, IDIV, MUL, IMUL] do
26 | for Y = [8, 16, 32, 64, DEF] do
27 | let RRW = $((X=="INC" or X=="DEC" or X=="NOT" or X=="NEG") and "rw" or "r")
28 | let AX = $((X=="DIV" or X=="IDIV" or X=="MUL" or X=="IMUL") and ",RAX/rw")
29 | let DIVDX = $((X=="DIV" or X=="IDIV") and Y~="8" and ",RDX/rw")
30 | let MULDX = $((X=="MUL" or X=="IMUL") and Y~="8" and ",RDX/w")
31 $(X86(Y)) $(X){_$(RSZ(Y))} $(RNAME("RCX", Y)) {|RCX/$(RRW),FLAGS/w $(AX) $(MULDX) $(DIVDX)}
32 $(X86(Y)) $(X){_M$(MSZ(Y))} <$(NASMSZ(Y))> [RCX] {|RCX/$(RRW),FLAGS/w $(AX) $(MULDX) $(DIVDX)}
36 | for Y = [16, 32, 64, DEF] do
37 $(X86(Y)) IMUL{_$(RSZ(Y))$(RSZ(Y))} $(RNAME("RCX", Y)), $(RNAME("RDX", Y)) {|RCX/rw,RDX/r,FLAGS/w}
38 $(X86(Y)) IMUL{_$(RSZ(Y))M} $(RNAME("RCX", Y)), <$(NASMSZ(Y))> [RAX] {|RCX/rw,RAX/r,FLAGS/w}
39 $(X86(Y)) IMUL{_$(RSZ(Y))$(RSZ(Y))I} $(RNAME("RCX", Y)), $(RNAME("RDX", Y)), <byte> 1 {|RCX/w,RDX/r,FLAGS/w}
40 $(X86(Y)) IMUL{_$(RSZ(Y))$(RSZ(Y))I} $(RNAME("RCX", Y)), $(RNAME("RDX", Y)), 0x100 {|RCX/w,RDX/r,FLAGS/w}
41 $(X86(Y)) IMUL{_$(RSZ(Y))MI} $(RNAME("RCX", Y)), <$(NASMSZ(Y))> [RAX], <byte> 1 {|RCX/w,RAX/r,FLAGS/w}
42 $(X86(Y)) IMUL{_$(RSZ(Y))MI} $(RNAME("RCX", Y)), <$(NASMSZ(Y))> [RAX], 0x100 {|RCX/w,RAX/r,FLAGS/w}
45 LEA{_WM} ECX, [RAX] {|RCX/w,RAX/r}
46 LEA{_WWWII} ECX, {EAX, EBX, 2, 0x40} <[RAX+RBX*2+0x40]> {|RCX/w,RAX/r,RBX/r}
47 64: LEA{_DM} RCX, [RAX] {|RCX/w,RAX/r}
48 64: LEA{_DDDII} RCX, {RAX, RBX, 2, 0x40} <[RAX+RBX*2+0x40]> {|RCX/w,RAX/r,RBX/r}
49 LEA{_RM} RCX, [RAX] {|RCX/w,RAX/r}
50 LEA{_RRRII} RCX, {RAX, RBX, 2, 0x40} <[RAX+RBX*2+0x40]> {|RCX/w,RAX/r,RBX/r}
52 | for X = [ROL, ROR, SHL, SHR, SAR, RCL, RCR] do
53 | let FRW = $((X=="RCL" or X=="RCR") and "rw" or "w")
54 | for Y = [8, 16, 32, 64, DEF] do
55 $(X86(Y)) $(X){_$(RSZ(Y))I} $(RNAME("RCX",Y)), 1 {|RCX/rw,FLAGS/$(FRW)}
56 $(X86(Y)) $(X){_$(RSZ(Y))I} $(RNAME("RCX",Y)), 2 {|RCX/rw,FLAGS/$(FRW)}
57 $(X86(Y)) $(X){_M$(MSZ(Y))I} <$(NASMSZ(Y))> [RAX], 1 {|RAX/r,FLAGS/$(FRW)}
58 $(X86(Y)) $(X){_M$(MSZ(Y))I} <$(NASMSZ(Y))> [RAX], 2 {|RAX/r,FLAGS/$(FRW)}
59 $(X86(Y)) $(X){_$(RSZ(Y))_CL} $(RNAME("RAX",Y))<, CL> {|RAX/rw,RCX/r,FLAGS/$(FRW)}
60 $(X86(Y)) $(X){_M$(MSZ(Y))_CL} <$(NASMSZ(Y))> [RAX]<, CL> {|RAX/r,RCX/r,FLAGS/$(FRW)}
64 | for X = [SHLD, SHRD] do
65 | for Y = [16, 32, 64, DEF] do
66 $(X86(Y)) $(X){_$(RSZ(Y))$(RSZ(Y))I} $(RNAME("RDX",Y)), $(RNAME("RAX",Y)), 2 {|RDX/rw,RAX/r,FLAGS/w}
67 $(X86(Y)) $(X){_M$(RSZ(Y))I} [RDX], $(RNAME("RAX",Y)), 2 {|RDX/r,RAX/r,FLAGS/w}
68 $(X86(Y)) $(X){_$(RSZ(Y))$(RSZ(Y))_CL} $(RNAME("RDX",Y)), $(RNAME("RAX",Y))<, CL> {|RDX/rw,RAX/r,RCX/r,FLAGS/w}
69 $(X86(Y)) $(X){_M$(RSZ(Y))_CL} [RDX], $(RNAME("RAX",Y))<, CL> {|RDX/r,RAX/r,RCX/r,FLAGS/w}