PDA

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.

Sly
25-11-2005, 02:10 PM
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.

LP
25-11-2005, 03:40 PM
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.

Sly
28-11-2005, 10:16 PM
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