21,496
社区成员
发帖
与我相关
我的任务
分享
/* file: e2.c
* gcc -Wall -o e2 e2.c
*/
#include <stdio.h>
typedef int S32;
S32 get_div_num(S32 indata, S32 nnum) {
register S32 __res__;
__asm__(
"xor %%edx, %%edx\n\t"
"div %%ebx\n\t"
: "=a"(__res__)
: "0"(indata), "b"(nnum)
: "%edx"
);
return __res__;
}
int main() {
printf("%d\n", get_div_num(100, 3));
return 0;
}