Mercurial > projects > ldc
comparison tests/mini/asm3.d @ 741:4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 30 Oct 2008 11:08:34 +0100 |
parents | 1bb99290e03a |
children | ef5f75ae6895 |
comparison
equal
deleted
inserted
replaced
740:96484f5bf5af | 741:4ac97ec7c18e |
---|---|
4 | 4 |
5 void main() | 5 void main() |
6 { | 6 { |
7 char* fmt = "Hello D World\n"; | 7 char* fmt = "Hello D World\n"; |
8 printf(fmt); | 8 printf(fmt); |
9 asm | 9 version (LLVM_InlineAsm_X86) |
10 { | 10 { |
11 push fmt; | 11 asm |
12 call printf; | 12 { |
13 pop EAX; | 13 push fmt; |
14 call printf; | |
15 pop AX; | |
16 } | |
14 } | 17 } |
18 else version(LLVM_InlineAsm_X86_64) | |
19 { | |
20 asm | |
21 { | |
22 movq RDI, fmt; | |
23 xor AL, AL; | |
24 call printf; | |
25 } | |
26 } | |
27 | |
15 } | 28 } |