annotate run/a/asm_jczx_01_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 2a1a6610f7ad
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_jcxz_01_A;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
6
1151
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
7 version(D_InlineAsm_X86){
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
8 version = runTest;
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
9 }else version(D_InlineAsm_X86_64){
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
10 version = runTest;
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
11 }
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
12
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
13 version(runTest){
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
14 int main(){
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
15 uint a;
1044
03c97933de98 inline ASM review
thomask
parents: 640
diff changeset
16
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
17 asm{
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
18 mov EAX, 0;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
19 mov CX, 0;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
20 jcxz save;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
21 add EAX, 1;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
22 save: mov a, EAX;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
23 }
1044
03c97933de98 inline ASM review
thomask
parents: 640
diff changeset
24
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
25 assert(a == 0);
1044
03c97933de98 inline ASM review
thomask
parents: 640
diff changeset
26
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
27 return 0;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
28 }
1151
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
29 }else{
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
30 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
31 static assert(0);
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
32 }