Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coctx_swap 最后的 xorl %eax, %eax 用意何在 ? #49

Open
prettykernel opened this issue Aug 30, 2017 · 3 comments
Open

coctx_swap 最后的 xorl %eax, %eax 用意何在 ? #49

prettykernel opened this issue Aug 30, 2017 · 3 comments

Comments

@prettykernel
Copy link

32 位 和 64 位的实现最后都把 eax 清 0,这是为了符合什么规范吗 ?

@inter169
Copy link

eax中的值(0)作为函数返回值给调用者

@prettykernel
Copy link
Author

这个函数的原型是;
extern "C" { extern void coctx_swap( coctx_t ,coctx_t ) asm("coctx_swap"); };
返回值不是void么?

@hammersmith-xie
Copy link

32位不知道,64位兼容32位,eax实际是rax的低32位,为了清零低32位,数据对齐。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants