annotate 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
rev   line source
lindquist@228 1 module tangotests.asm3;
lindquist@228 2
lindquist@228 3 extern(C) int printf(char*, ...);
lindquist@228 4
lindquist@228 5 void main()
lindquist@228 6 {
lindquist@228 7 char* fmt = "Hello D World\n";
lindquist@228 8 printf(fmt);
kamm@741 9 version (LLVM_InlineAsm_X86)
lindquist@228 10 {
kamm@741 11 asm
kamm@741 12 {
kamm@741 13 push fmt;
kamm@741 14 call printf;
kamm@741 15 pop AX;
kamm@741 16 }
lindquist@228 17 }
kamm@741 18 else version(LLVM_InlineAsm_X86_64)
kamm@741 19 {
kamm@741 20 asm
kamm@741 21 {
kamm@741 22 movq RDI, fmt;
kamm@741 23 xor AL, AL;
kamm@741 24 call printf;
kamm@741 25 }
kamm@741 26 }
kamm@741 27
lindquist@228 28 }