View Full Version : A Day in the Life of Andy Thomason
Sascha Willems
25-11-2005, 11:04 AM
Gamasutra ('http://www.gamasutra.com') has another interesting article up (again, those of you who don't know Gamasutra : Go and find out, you're missing something) which describes a typical day in the life of Andy Thomason, who works for SN (now owned by Sone), a company that creates tools for console developement. It's an interesting read ('http://www.gamasutra.com/features/20051124/thomason_01.shtml') and also shows that coding for consoles is a whole different thing than coding for PCs.
Don't I know it. PCs have no restrictions relative to consoles.
One thing I like about C is the code example he gave.
if (x == y) pPtr++;
compared to
pPtr += (x == y);
Same effect but executes faster due to cost of stalls due to branch mis-predictions in the first example. That is something that is just not possible in Pascal.
That is something that is just not possible in Pascal.
Have you tried this:
Inc(Integer(pPtr), Integer(x = y));
(edit) Which translates into (see CPU window):
xor eax, eax
cmp ecx, edx
setz dl
and edx, $7f
add eax, edx
athomason
28-11-2005, 12:38 PM
I still have a fondness for Pascal as a programming language.
We worked on some big pascal projects back in the 80's and I had the pleasure of meeting Jensen in London.
That is something that is just not possible in Pascal.
Have you tried this:
Inc(Integer(pPtr), Integer(x = y));
(edit) Which translates into (see CPU window):
xor eax, eax
cmp ecx, edx
setz dl
and edx, $7f
add eax, edx
Well dang! I never thought of that. Messier than the C version, but it should still work.
Clootie
29-11-2005, 06:46 AM
This performs EXACTLY the same as C code:
Inc(pPtr, Ord(x = y));
It's not a Delphi problem that C doesn't have boolean type - it's a C problem :D
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.