Quote Originally Posted by Kamikaze47
why did it only affect the shift on the last line, and not the first three?
Exactly, that was the question I had too.

But as it turns out, the problem was in the 3rd/4th byte, only when shifting 1 place. Found that easily using the ISIS simulator.
So shifting 8100 the first time, wasn't big enough for the 3rd/4th byte to matter.

With the second and third shift it uses a different part of the macro.
The Input and Output variables are the same (Nout) == (Nin), so it uses the code in Red (4 instructions)

Then on the last line, the Input and Output variables were different, so it used the code in blue, the number was big enough, and the 3rd byte was corrupt.
--Error-- Danger Will Robinson, Danger, Danger.

Code:
SHIFTL?NCN macro Nin, Cin, Nout
    if ((Cin) == 1)
        bcf     STATUS, C
      if ((Nout) == (Nin))
        CHK?RP  Nout
        rlcf    Nout, F
        rlcf    (Nout) + 1, F
        rlcf    (Nout) + 2, F
        rlcf    (Nout) + 3, F
      else
        CHK?RP  Nin
        rlcf    Nin, W
        MOVE?AB Nout
        CHK?RP  Nin
        rlcf    (Nin) + 1, W
        MOVE?AB (Nout) + 1
        CHK?RP  Nin
        rlcf    (Nin) + 2, W
        MOVE?AB (Nout) + 2
        CHK?RP  Nin
        rlcf    (Nin) + 3, W     ; was 2
        MOVE?AB (Nout) + 3
      endif
    else
        MOVE?NN Nin, R0
        movlw   Cin
        L?CALL  SHIFTL
        MOVE?ANN R0, Nout
    endif
    endm
SHIFTL_USED = 1
  endmod
To answer your previous question.

When you shift more than 1 place at a time, it copies the variable to a system register, saves how many bits to shift, then calls a Library routine (SHIFTL) to loop through the number of shifts required. There's quite a bit of overhead in that saving and looping. (the Magenta code)

Avoiding that is how I got the speed increase in my previous post.
Although my previous numbers have no bearing on PBPL.

If that actually made any sense, I will eat a bug.