annotate tests/mini/asm6.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents
children 4ac97ec7c18e
rev   line source
lindquist@341 1 extern(C) int printf(char*, ...);
lindquist@341 2
lindquist@341 3 void main()
lindquist@341 4 {
lindquist@341 5 int a,b,c;
lindquist@341 6 a = int.max-1;
lindquist@341 7 b = 1;
lindquist@341 8 asm
lindquist@341 9 {
lindquist@341 10 mov EAX, a;
lindquist@341 11 mov ECX, b;
lindquist@341 12 add EAX, ECX;
lindquist@341 13 jo Loverflow;
lindquist@341 14 mov c, EAX;
lindquist@341 15 }
lindquist@341 16
lindquist@341 17 printf("c == %d\n", c);
lindquist@341 18 assert(c == a+b);
lindquist@341 19 return;
lindquist@341 20
lindquist@341 21 Loverflow:
lindquist@341 22 assert(0, "overflow");
lindquist@341 23 }