annotate tests/mini/asm3.d @ 1651:cb960b882ca3 tip

bindings were moved to dsource.org/projects/bindings/
author Moritz Warning <moritzwarning@web.de>
date Thu, 20 May 2010 20:05:03 +0200
parents 4c524d80e6e1
children
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@1035 9 version (D_InlineAsm_X86)
lindquist@228 10 {
tomas@945 11 asm
tomas@945 12 {
tomas@945 13 push fmt;
tomas@945 14 call printf;
tomas@945 15 pop EAX;
tomas@945 16 }
lindquist@228 17 }
kamm@1035 18 else version(D_InlineAsm_X86_64)
kamm@741 19 {
kamm@741 20 asm
kamm@741 21 {
tomas@945 22 movq RDI, fmt;
tomas@945 23 xor AL, AL;
tomas@945 24 call printf;
kamm@741 25 }
kamm@741 26 }
lindquist@228 27 }