test: nasm-t -- Add imul
[nasm.git] / travis / test / imul.asm
blobbfb6e05423a183f212958521e583bf9c12d4261e
1 %macro test 1-3 5 -2
2 bits %1
4 %undef MEM
5 %if %1 == 16
6 %define MEM [di]
7 %elif %1 == 32
8 %define MEM [edi]
9 %elif %1 == 64
10 %define MEM [rdi]
11 %endif
13 imul al
14 imul byte MEM
15 imul ax
16 imul word MEM
17 imul eax
18 imul dword MEM
19 %if %1 == 64
20 imul rdx
21 imul qword MEM
22 %endif
24 imul ax,cx
25 imul ax,MEM
26 imul ax,word MEM
27 imul eax,ecx
28 imul eax,MEM
29 imul eax,dword MEM
30 %if %1 == 64
31 imul rax,rcx
32 imul rax,MEM
33 imul rax,qword MEM
34 %endif
36 imul ax,cx,%2
37 imul ax,cx,byte %2
38 imul ax,MEM,%2
39 imul ax,word MEM,%2
40 imul eax,ecx,%2
41 imul eax,ecx,byte %2
42 imul eax,MEM,%2
43 imul eax,dword MEM,%2
44 %if %1 == 64
45 imul rax,rcx,%2
46 imul rax,rcx,byte %2
47 imul rax,MEM,%2
48 imul rax,qword MEM,%2
49 %endif
51 imul ax,%2
52 imul ax,byte %2
53 imul eax,%2
54 imul eax,byte %2
55 %if %1 == 64
56 imul rax,%2
57 imul rax,byte %2
58 %endif
60 imul ax,cx,0x1234
61 imul ax,MEM,0x1234
62 imul ax,word MEM,0x1234
63 imul eax,ecx,0x12345678
64 imul eax,MEM,0x12345678
65 imul eax,dword MEM,0x12345678
66 %if %1 == 64
67 imul rax,rcx,0x12345678
68 imul rax,MEM,0x12345678
69 imul rax,qword MEM,0x12345678
70 %endif
72 imul ax,0x1234
73 imul eax,0x12345678
74 %if %1 == 64
75 imul rax,0x12345678
76 %endif
78 imul ax,cx,0xfffe
79 imul ax,MEM,0xfffe
80 imul ax,word MEM,0xfffe
81 imul ax,cx,0xfe
82 imul ax,MEM,0xfe
83 imul ax,word MEM,0xfe
84 imul eax,ecx,0xfffffffe
85 imul eax,MEM,0xfffffffe
86 imul eax,dword MEM,0xfffffffe
87 imul eax,ecx,0xfffe
88 imul eax,MEM,0xfffe
89 imul eax,dword MEM,0xfffe
90 %if %1 == 64
91 imul rax,rcx,%3
92 imul rax,MEM,%3
93 imul rax,qword MEM,%3
94 imul rax,rcx,0xfffe
95 imul rax,MEM,0xfffe
96 imul rax,qword MEM,0xfffe
97 %endif
99 imul ax,0xfffe
100 imul eax,0xfffffffe
101 %if %1 == 64
102 imul rax,%3
103 %endif
104 %endmacro
106 test 16
107 test 32
108 test 64
110 %ifdef WARN
111 test 16,0x999
112 test 32,0x999999
113 test 64,0x999999999,0xfffffffe
114 %endif