View Single Post
  #6   Spotlight this post!  
Unread 04-10-2005, 19:37
BrianBSL BrianBSL is offline
Registered User
FRC #0190
 
Join Date: Sep 2004
Rookie Year: 2000
Location: Worcester, MA
Posts: 251
BrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud of
Re: 16 bit math on PIC

Quote:
Originally Posted by Dave Flowerday
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.
The PIC is sort of different than the x86, theres only one working register in the sense ax, bx, etc of the x86 (that you can use as a location to put data you will preform operations on), "w". f is either a special function register (io bits, status bits, or control bits) or a general function register (RAM), which is limited to 7 bits, per bank. You change the bank by switching a status bit. (RP0 and RP1 on a 16F87x IIRC).

I'm not sure if this is what you are reading, but f is limited to 7 bits, as each bank goes to 7F.

edit:
switched rb0 to rp0 (the correct bitname in the status register)

Last edited by BrianBSL : 04-10-2005 at 19:41.