News for hackers. Stuff that matters.
Re:Why C Is Not Assembly by zafka on Tuesday September 14, 2010 @09:17AM (#1690395)
>For example, C won't implement the "raise to nth power" >operator (in Python, 210 means 2 to the power of 10, for >example), because it can't be done with one assembly >instruction, only with a loop.

Not a great example of your point. Here is Analog devices Assembly for the ADSP-2100 Family. Assuming Ar is loaded with 2:

sr=LSHIFT ar by 10;

Even without the assumption, no loop is needed for raising 2 to some power.

Re:Why C Is Not Assembly by mansr on Tuesday September 14, 2010 @03:45PM (#1692002)
What you are doing there is multiplying something by a power of two, and 'ar' should have the value 1 for 'sr' to be set to two to the power of 10.

Multiplying by a power of 2 is easily done in C using the shift operator.