View Single Post
  #9   Spotlight this post!  
Unread 04-10-2005, 21:33
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: 16 bit math on PIC

Quote:
Originally Posted by sciguy125
I think that the contents are limited to 127. If you look at some of the other instructions, they say 0<f<255.
I don't see any that say 0 < f < 255, however I see some that say 0 <= k <= 255. In that case, though, k is an immediate value, not a register number, so it makes sense that a full 8 bit value would be allowed.
Quote:
I'm pretty sure it has something to do with signed vs unsigned contents, but I don't know what happens if the instruction causes it to overflow.
The processor doesn't care whether or not the number is signed. That's the beauty of two's complement notation - you can interpret a number as signed or unsigned, and it doesn't matter to the processor. Addition and subtraction "just work" whether it's signed or not.