Shop OBEX P1 Docs P2 Docs Learn Events
Assembly - Adding? — Parallax Forums

Assembly - Adding?

John A. ZoidbergJohn A. Zoidberg Posts: 514
edited 2011-04-22 10:14 in Propeller 1
Hello there,

I read in the datasheet for the Propeller that the Add instruction takes a 32-bit source, and a 5-bit literal.

So it can't do 32-bit + 32-bit? So how am I going to get around to doing it? Or I'm reading the "5-bit literal" wrong?

Thanks. :)

Comments

  • lonesocklonesock Posts: 917
    edited 2011-04-22 10:14
    The 9-bit literal is either a constant (0..511) if you use the # character, or the address of another cog variable, which would be a 32 bit number. If you want to add a constant larger than 511, you need to make a fake constant eg "const32768 long 32768".

    Note: the only 5-bit numbers I can think of off the top of my head relate to the rotate and shift PASM instructions.

    Jonathan
Sign In or Register to comment.