annotate run/a/asm_mul_01_B.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents 03c97933de98
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
1 // $HeadURL$
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
2 // $Date$
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
3 // $Author$
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
4
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_mul_01_B;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
6
1010
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
7 version(D_InlineAsm_X86){
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
8 version = runTest;
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
9 }else version(D_InlineAsm_X86_64){
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
10 version = runTest;
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
11 }
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
12
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
13 version(runTest){
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
14 int main(){
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
15 ushort a, b;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
16 ushort x = short.max+2;
1044
03c97933de98 inline ASM review
thomask
parents: 1010
diff changeset
17
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
18 asm{
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
19 mov EAX, 0x12_34_56_78u;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
20 mov EDX, 0x12_34_56_78u;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
21 mov AX, 2;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
22 mul x;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
23 mov a, DX;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
24 mov b, AX;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
25 }
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
26
1010
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
27 if(a != 1){
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
28 assert(0);
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
29 }
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
30 if(b != 2){
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
31 assert(0);
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
32 }
1044
03c97933de98 inline ASM review
thomask
parents: 1010
diff changeset
33
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
34 return 0;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
35 }
1010
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
36 }else{
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
37 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
38 static assert(0);
731f93c13ad6 inline ASM review
thomask
parents: 640
diff changeset
39 }