Shop OBEX P1 Docs P2 Docs Learn Events
Different results with literal vs. register — Parallax Forums

Different results with literal vs. register

SSteveSSteve Posts: 808
edited 2006-05-19 17:25 in Propeller 1
I was doing some experiments with Propeller assembly this evening and I was running into some weird results. I finally realized that the weird results were happening whenever I was using a literal value in a statement. I reduced it to a small program that illustrates the problem.

If you run the attached program on the demo board, the LEDs will blink five times.

If you then comment out line 24 and use line 26 instead, the LEDs don't blink. I can't figure out why this is happening.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows

Comments

  • SSteveSSteve Posts: 808
    edited 2006-05-19 07:50
    The answer jumped out at me right as I clicked Submit. The 'S' portion of the instruction is 9 bits, so literals have to be less than 512.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    Post Edited (SSteve) : 5/19/2006 7:57:24 AM GMT
  • Phillip Y.Phillip Y. Posts: 62
    edited 2006-05-19 17:12
    It would be nice if the Propeller Tool checks the value of #Literals used for the 9 bit data range.
  • cgraceycgracey Posts: 14,206
    edited 2006-05-19 17:20
    Good idea. I'll see about adding this today.
    Phillip Y. said...
    It would be nice if the Propeller Tool checks the value of #Literals used for the 9 bit data range.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • Dave ScanlanDave Scanlan Posts: 160
    edited 2006-05-19 17:25
    A necessary addition...I had exactly the same problem.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··
Sign In or Register to comment.