Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/03/09 12:42
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#168105 - C is really unsuited for this purpose.
Responding to: ???'s previous message
Yogesh Gudekar said:
I want to carry out following Hexadecimal Arithmetic operation using C code


C is very much unsuited for this purpose as it does not allow the programmer to access the carry flag, which is essential for performing extended (i.e. higher than supported natively by the CPU) width arithmetics without wasting lots of CPU cycles on "manual" overflow checks.

In C, you would have to check for overflow without using the carry flag ... which is certainly possible, but a major drain on CPU resources (cycles, program space, etc).

Hence, extended-width arithmetics are usually implemented as assembly functions that are callable from C.

Are you really, really sure this _must_ be done in C?

List of 7 messages in thread
TopicAuthorDate
Hexadecimal Arithmetic            01/01/70 00:00      
   Cross-post            01/01/70 00:00      
   C is really unsuited for this purpose.            01/01/70 00:00      
      RE: 'C' does not allow access to the carry flag            01/01/70 00:00      
         That shoots down the reason to use C:            01/01/70 00:00      
   hexadecimal arithmetic            01/01/70 00:00      
      You already have answers to that question!            01/01/70 00:00      

Back to Subject List