annotate run/a/asm_add_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 7a397590d6e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
1 // $HeadURL$
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
2 // $Date$
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
3 // $Author$
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
4
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_add_01_B;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
6
987
1c9d1337cb77 inline asm review
thomask
parents: 973
diff changeset
7 version(D_InlineAsm_X86){
989
a468938b0160 inline ASM review
thomask
parents: 987
diff changeset
8 version = runTest;
987
1c9d1337cb77 inline asm review
thomask
parents: 973
diff changeset
9 }else version(D_InlineAsm_X86_64){
989
a468938b0160 inline ASM review
thomask
parents: 987
diff changeset
10 version = runTest;
987
1c9d1337cb77 inline asm review
thomask
parents: 973
diff changeset
11 }
1c9d1337cb77 inline asm review
thomask
parents: 973
diff changeset
12
1062
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
13 version(runTest){
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
14 int main(){
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
15 uint i = 0x12_23_45_56u;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
16 ushort s = 0xFFFFu;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
17
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
18 asm{
973
8c327aff56f3 extended asm tests
thomask
parents: 638
diff changeset
19 mov EAX, 0x98_76_54_32;
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
20 mov AX, s;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
21 add AX, 1;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
22 mov i, EAX;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
23 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
24
1062
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
25 if(i != 0x98_76_00_00u){
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
26 assert(0);
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
27 }
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
28 if(s != 0xFFFFu){
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
29 assert(0);
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
30 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
31
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
32 return 0;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
33 }
1062
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
34 }else{
1386
7a397590d6e0 64-bit fixes
thomask
parents: 1062
diff changeset
35 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
1062
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
36 static assert(0);
973
8c327aff56f3 extended asm tests
thomask
parents: 638
diff changeset
37 }