Shop OBEX P1 Docs P2 Docs Learn Events
strange assembly problem — Parallax Forums

strange assembly problem

CJCJ Posts: 470
edited 2007-03-05 22:05 in Propeller 1
for some reason, I get garbage data in my Gamecube controller driver when trying to optimize some of my code

I clear the data holding registers at the beginning of my loop to 0
then as the data comes in I use the carry flag to set the data bits accordingly

I am trying to replace this
IF_C OR data1, #1
        SHL data1, #1




with this
RCL data1, #1




are these not equivalent, or am I missing something here?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax Forums - If you're ready to learn, we're ready to help.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-05 20:36
    They're not equivalent. The first one effectively copies the C flag into the LSB of data1, then shifts it left. The second one shifts data1 left, then copies the C flag into the LSB (sort of).
  • CJCJ Posts: 470
    edited 2007-03-05 22:05
    thanks, looks like I have some LSB bugs to tackle in my recently posted objects, fortunately they stem from one source

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax Forums - If you're ready to learn, we're ready to help.
Sign In or Register to comment.