【发布时间】:2014-10-28 12:55:22
【问题描述】:
我无法理解 IsPrime 函数中的循环。我主要无法理解代码中的前几行。 x86 程序集 32 位。栈大小为36,有可能是代码有错误
.L4: #odd number
movl 8(%ebp), %eax #move arg(odd number) into eax
movl %eax, -28(%ebp)
movl $1431655766, -32(%ebp) #having trouble understanding this line
movl -32(%ebp), %edx
imull -28(%ebp)
movl %edx, %ecx
movl -28(%ebp), %eax
sarl $31, %edx #and what this does
movl %ecx, %edx
subl %eax, %edx
movl %edx, -24(%ebp)
movl -24(%ebp), %eax
addl %eax, %eax
addl -24(%ebp), %eax
movl -28(%ebp), %ecx
subl %eax, %ecx
movl %ecx, -24(%ebp)
cmpl $0, -24(%ebp)
jne .L7
cmpl $3, 8(%ebp)
jne .L6
【问题讨论】:
-
如果是家庭作业,而“A. Bhattacharjee”是你的老师,那么兄弟,你有麻烦了!