Mercurial > projects > ldc
diff tangotests/asm1.d @ 220:ccc2e6898a78 trunk
[svn r236] added initial codegen of inline asm, pretty buggy and incomplete still. see the tangotests/asm1.d test for a sample of what does
work!
author | lindquist |
---|---|
date | Fri, 06 Jun 2008 20:14:51 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tangotests/asm1.d Fri Jun 06 20:14:51 2008 +0200 @@ -0,0 +1,21 @@ +module tangotests.asm1; + +extern(C) int printf(char*, ...); + +int main() +{ + int i = 12; + int* ip = &i; + printf("%d\n", i); + asm + { + mov EBX, ip; + mov EAX, [EBX]; + add EAX, 8; + mul EAX, EAX; + mov [EBX], EAX; + } + printf("%d\n", i); + assert(i == 400); + return 0; +}