Mercurial > hg > CbC > CbC_examples
changeset 19:ead7c2743f0e
return value is correct
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 Jan 2016 00:48:37 +0900 |
parents | bec7f99b60b5 |
children | c181f93d4e30 |
files | asmtest2.c |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/asmtest2.c Sun Jan 24 06:03:01 2016 +0900 +++ b/asmtest2.c Mon Jan 25 00:48:37 2016 +0900 @@ -27,8 +27,11 @@ __code print(int n,int result,int orig,__code(*print)(),__code (*exit1)(int, void*),void*exit1env) { printf("#0032:%d! = %d\n",orig, result); - asm volatile("movq 0x8(%%rdi), %%rbp;" - "movq 0x10(%%rdi), %%rsp;" - "jmpq *0x38(%%rdi);" - ::"D"(((struct __CbC_env *)exit1env)->env)); + asm volatile("movq (%%rdi), %%r10;" + "movq $100, (%%r10);" + "movq 0x18(%%rdi), %%rbp;" + "movq 0x20(%%rdi), %%rsp;" + "jmpq *0x48(%%rdi);" + :"+D"(exit1env)::"r10" + ); }