What does Assembly LSLF do? [SOLVED]

Thread Starter

jpanhalt

Joined Jan 18, 2008
11,087
Code:
     movwf     tempF          ;f = rrrrrbbb
     lslf      tempF,f        ;f = rrrrbbb0 , discard msb
     movlw     0xF0           ;
At first breakpoint:
1579639278585.png
After lslf:
1579639371807.png

Language: MPASM Assembly
MPLab 8.92
MCU: 16F1783
Re-assembled and programmed with same result. Used to work.
 

ApacheKid

Joined Jan 12, 2015
1,762
Code:
     movwf     tempF          ;f = rrrrrbbb
     lslf      tempF,f        ;f = rrrrbbb0 , discard msb
     movlw     0xF0           ;
At first breakpoint:
View attachment 197359
After lslf:
View attachment 197361

Language: MPASM Assembly
MPLab 8.92
MCU: 16F1783
Re-assembled and programmed with same result. Used to work.
Not clear on what you're asking, it seems that instruction is documented on page 256 of this document. Are you seeing different behavior?
 

Thread Starter

jpanhalt

Joined Jan 18, 2008
11,087
Which version of lslf clears the LSB and rotates left? ;)

The 16F1829 and 16F1783 should work the same, so far as I know.

The 16F1783 is in hardware simulation. The 16F1829 is just software sim. The program on the 16F1783 worked well before modification of another area in the code in both hardware simulation and release form .
 
Last edited:

Thread Starter

jpanhalt

Joined Jan 18, 2008
11,087
Thinking there might be a bizarre glitch, I deleted those 3 plus an additional line of code. Re-assembled, programmed and ran up to the breakpoint. Steps past that breakpoint worked as expected. Then pasted back the code, repeated the steps, including clearing GPR's, and the error was still there:

1579642388736.png
The simulation is clearing tempF,0 then rotating left.

Since at that point, temp0 and tempF have the same contents, I changed the instruction to lslf temp0 and it worked correctly:

1579643175680.png

SOLVED
The modified code changed W, so the movwf was what was actually the problem. W was decreased by one to check for zero in the revision. Plus just 3 hours of sleep (3 AM to 6 AM).
 
Last edited:
Top