annotate run/a/asm_dec_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
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_dec_01_B;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
6
989
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
7 version(D_InlineAsm_X86){
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
8 version = runTest;
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
9 }else version(D_InlineAsm_X86_64){
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
10 version = runTest;
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
11 }
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
12
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
13 int main(){
989
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
14 version(runTest){
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
15 uint i = 0x01_01_00_00u;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
16
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
17 asm{
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
18 mov EAX, i;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
19 dec AX;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
20 mov i, EAX;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
21 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
22
989
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
23 if(i != 0x01_01_FF_FFu){
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
24 assert(0);
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
25 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
26
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
27 return 0;
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
28 }else{
989
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
29 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
638
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
30 static assert(0);
61d8b062bf80 added some basic integer asm operations and registers tests
thomask
parents:
diff changeset
31 }
989
a468938b0160 inline ASM review
thomask
parents: 638
diff changeset
32 }