This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Wednesday, August 6, 2008

Re: [oopic] Re: left/right bit shifting

At 09:13 PM 8/5/2008, scottmsavage wrote:
>--- In oopic@yahoogroups.com, Andrew Porrett <slicerwizard@...> wrote:
> > The V5 compiler has never supported some basic operators like
> > left/right bit shifting. I don't recall if this has been fixed in V6.
> > ... Andy
>
>The left/right bit shifting is a method of the value itself.
>
>a.RShift

More doublespeak. Lshift and Rshift are nothing more than unsigned
multiply and divide by 2. True shift operators are binary operators
- they have two operands, namely the value to be shifted and the
number of bits to shift.

To build an appropriate bitmask for a given task, I have to shift a
value of 1 left by <n> bits, like so:

mask = 1 << n;

But the OOPic doesn't support this from what I've seen. Instead, I
have to set up a slow loop in script code:

mask = 1;

for (i = 0; i < n; ++i)
mask = mask * 2;

And I can't even use the ++i unless I use my preprocessor (or has
that been fixed in V6?)


...Andy

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments: