View previous topic :: View next topic |
Author |
Message |
helmudt
Joined: 11 Jan 2005 Posts: 1
|
right_shift function |
Posted: Tue Jan 11, 2005 4:53 am |
|
|
Hi guys,
How do you tell the compiler to use the “Carry” data when you use the right_shift() function. The ASM code generated when I use the right_shift command is “RRNCF”
P.s I'm using the Pic18F452
Thanks
Helmudt |
|
|
Ttelmah Guest
|
Re: right_shift function |
Posted: Tue Jan 11, 2005 7:25 am |
|
|
helmudt wrote: | Hi guys,
How do you tell the compiler to use the “Carry” data when you use the right_shift() function. The ASM code generated when I use the right_shift command is “RRNCF”
P.s I'm using the Pic18F452
Thanks
Helmudt |
This is the difference between a 'shift', and a 'rotate'. Look at 'rotate_right', instead of 'shift_right'.
Best Wishes |
|
|
densimitre
Joined: 21 Dec 2004 Posts: 45
|
|
Posted: Thu Jan 13, 2005 6:05 pm |
|
|
rotate_left() puts carry in LSB
shift_left(a,b,c) puts c on LSB, carry it doesn't matter.
C can be 0 or 1, as you wich.
Bye |
|
|
|