View Single Post
  #6   Spotlight this post!  
Unread 21-01-2004, 12:29
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: efficiency of working with integers

Quote:
Originally Posted by WizardOfAz
At its heart, it's an 8 bit chip. To do arithmetic on more than 8 bits the compiler has to generate a sequence of operations, manage the carry bit, and so on. That's why working with 8 bit values is more efficient if what you're doing can fit in 8 bits.
exactly - a char-char ADD op is a single instruction, whereas an int-int add requires two (and that's assuming the second ADD op automatically utilizes the set carry bit).
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)