annotate run/a/asm_bsr_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
856
7b2c5a101190 meta data maintenance
thomask
parents: 698
diff changeset
1 // $HeadURL$
7b2c5a101190 meta data maintenance
thomask
parents: 698
diff changeset
2 // $Date$
7b2c5a101190 meta data maintenance
thomask
parents: 698
diff changeset
3 // $Author$
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
4
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_bsr_01_B;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
6
987
1c9d1337cb77 inline asm review
thomask
parents: 856
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: 856
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: 856
diff changeset
11 }
1c9d1337cb77 inline asm review
thomask
parents: 856
diff changeset
12
1063
4c41b782a14e pre 0.162 review
thomask
parents: 1044
diff changeset
13 version(runTest){
4c41b782a14e pre 0.162 review
thomask
parents: 1044
diff changeset
14 int main(){
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
15 ushort a = 0x3000;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
16
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
17 asm{
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
18 bsr AX, a;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
19 mov a, AX;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
20 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
21
987
1c9d1337cb77 inline asm review
thomask
parents: 856
diff changeset
22 if(a != 13){
1c9d1337cb77 inline asm review
thomask
parents: 856
diff changeset
23 assert(0);
1c9d1337cb77 inline asm review
thomask
parents: 856
diff changeset
24 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
25
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
26 return 0;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
27 }
1063
4c41b782a14e pre 0.162 review
thomask
parents: 1044
diff changeset
28 }else{
1386
7a397590d6e0 64-bit fixes
thomask
parents: 1063
diff changeset
29 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
1063
4c41b782a14e pre 0.162 review
thomask
parents: 1044
diff changeset
30 static assert(0);
987
1c9d1337cb77 inline asm review
thomask
parents: 856
diff changeset
31 }