Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homework crashes, I can't figure out why
#4
Both conditions in your while statement get evaluated because you are performing the bitwise AND on the results of the two condtions. See the edit to my first reply.

For a statement such as:
while i>=0 and a(i)>value

fbc.exe produces this assembly language code:

mov eax, dword ptr [_Ii]
test eax, eax
setge al
shr eax, 1
sbb eax, eax
mov ebx, dword ptr [_Ii]
mov ecx, dword ptr [_Ai+ebx*4]
cmp ecx, dword ptr [_VALUEi]
setg cl
shr ecx, 1
sbb ecx, ecx
and eax, ecx


Notice that both calculation are performed every time.
Reply


Messages In This Thread
Homework crashes, I can't figure out why - by RyanKelly - 02-18-2006, 08:49 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)