PIC16f877A byte reverse

Discussion in 'Programmer's Corner' started by simo_x, Mar 17, 2011.

  1. simo_x

    Thread Starter Member

    Dec 23, 2010
    Hi all, I have to reverse a byte with a PIC16F877A in Assmbly code.
    I tried to implement a function by shifting to left te W register, tried with a function with 256 retlw but it also did not work due to stack overflow..

    Do you know or do you have an algorithm for this purpose?
    Thank you for your help
    Last edited: Mar 17, 2011
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    It would be nice to have some idea of which programming language you use. And what you have done so far.
  3. simo_x

    Thread Starter Member

    Dec 23, 2010
    I am sorry. I understand your correctly answer. I have edited the post later.. I work with Assembly Language in MPLAB.
    Later I will post my wrong code, I can't post it now due to it's on Windows in VBox, just turned it off and I have to turn off the laptop. :(
  4. Markd77

    Senior Member

    Sep 7, 2009
    How about:
    clrf temp
    bftsc source, 0
    bsf temp, 7
    bftsc source, 1
    bsf temp, 6