annotate run/a/asm_test_02_A.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
1044
03c97933de98 inline ASM review
thomask
parents:
diff changeset
1 // $HeadURL$
03c97933de98 inline ASM review
thomask
parents:
diff changeset
2 // $Date$
03c97933de98 inline ASM review
thomask
parents:
diff changeset
3 // $Author$
03c97933de98 inline ASM review
thomask
parents:
diff changeset
4
03c97933de98 inline ASM review
thomask
parents:
diff changeset
5 module dstress.run.a.asm_test_02_A;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
6
03c97933de98 inline ASM review
thomask
parents:
diff changeset
7 version(D_InlineAsm_X86){
03c97933de98 inline ASM review
thomask
parents:
diff changeset
8 version = runTest;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
9 }else version(D_InlineAsm_X86_64){
03c97933de98 inline ASM review
thomask
parents:
diff changeset
10 version = runTest;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
11 }
03c97933de98 inline ASM review
thomask
parents:
diff changeset
12
03c97933de98 inline ASM review
thomask
parents:
diff changeset
13 version(runTest){
03c97933de98 inline ASM review
thomask
parents:
diff changeset
14 int main(){
03c97933de98 inline ASM review
thomask
parents:
diff changeset
15 ubyte a = 3u;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
16 ubyte b = 2u;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
17
03c97933de98 inline ASM review
thomask
parents:
diff changeset
18 asm{
03c97933de98 inline ASM review
thomask
parents:
diff changeset
19 mov AL, a;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
20 mov BL, b;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
21 test BL, AL;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
22 jz error;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
23 js error;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
24 jp error;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
25 }
03c97933de98 inline ASM review
thomask
parents:
diff changeset
26
03c97933de98 inline ASM review
thomask
parents:
diff changeset
27 return 0;
03c97933de98 inline ASM review
thomask
parents:
diff changeset
28 error:
03c97933de98 inline ASM review
thomask
parents:
diff changeset
29 assert(0);
03c97933de98 inline ASM review
thomask
parents:
diff changeset
30 }
03c97933de98 inline ASM review
thomask
parents:
diff changeset
31 }else{
1386
7a397590d6e0 64-bit fixes
thomask
parents: 1044
diff changeset
32 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
1044
03c97933de98 inline ASM review
thomask
parents:
diff changeset
33 static assert(0);
03c97933de98 inline ASM review
thomask
parents:
diff changeset
34 }