Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
output ASM
#2
I also noticed with:

IF (available = 1) or (available=2) or (available=4) or (available=8)

that the code doesn't do short-circuit testing with OR - it's possible, here to do

if available=1 then stop testing, because we're already true
else if available=2 then stop testing here because....


etc.

Instead it tests all four conditions, all the time. I suspect IF available=1 then elseif might be faster assembly because the short circuit jumps tp the end get put in. However, it would need the action part multiple times, so would be bigger Sad
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)