View Single Post
  #5   Spotlight this post!  
Unread 04-10-2005, 16:55
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
The lower byte of the result takes a full 8 bits. However, according to the datasheet, the addwf instruction that I would use only goes up to 127 (7 bits which I presume is to keep it signed with the 8th bit). How would this affect what I want to do?
I'm not overly familiar with PIC assembly, but from looking at the datasheet I think I understand the problem. I'm guessing that you're looking at the part of the datasheet that says "Operands: 0 <= f <= 127", right? I believe all this is saying is that f (which is specifying a register number) can't be greater than 127, since that PIC only has 128 registers. The contents of the register can be larger than that, however.