69,371
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h> // 声明atoll函数
int main()
{
char tempbuf[]="430007020001";
long long int unit;
unit=atoll(tempbuf);
return 0;
}
call atoll ;调用atoll。返回值的低32位保存在eax,高32位保存在edx
addl $16, %esp ; 调整栈指针,与本题无关
movl %eax, -32(%ebp) ; 把eax里保存的低32位保存到局部变量unit的低32位
movl %edx, -28(%ebp) ; 把edx里保存的高32位保存到局部变量unit的高32位
call atoll
addl $16, %esp
cltd ; AT&T汇编里的cltd指令相当于cdq指令,作用是把eax的32位整数扩展为64位,高32位用eax的符号位填充保存到edx
movl %eax, -32(%ebp)
movl %edx, -28(%ebp)