1

I'm trying to shift bits left in .asm via the rlcf by rotating, and then clearing the carry. Is this going to work? If not, can I get some help? For some reason this won't compile and it's driving me crazy, this is such a simple program yet I can't get it. All help greatly appreciated.

count equ 0x20
byte equ 0x21

;shift right

movlw b'11111110'
movwf byte
bcf STATUS,C
rlcf Byte ;for left shift
bcf STATUS,C
loop
end
Wilk
  • 7,873
  • 9
  • 46
  • 70
matt
  • 79
  • 2
  • 13

1 Answers1

1

Note that shift left X by 1 is exactly X + X -- use the add (addwf) instruction.

Doug Currie
  • 40,708
  • 1
  • 95
  • 119