Shop OBEX P1 Docs P2 Docs Learn Events
Lesson du jour: check your PASM jump destination labels!! — Parallax Forums

Lesson du jour: check your PASM jump destination labels!!

MJHanaganMJHanagan Posts: 189
edited 2014-12-14 11:43 in Propeller 1
I have banged my head for may hours this afternoon trying to track down an intermittent bug in some really simple PASM code. At the end I had more lines of debugging code than loopholes in the Federal tax code. I was just now typing up a plea for help from the forum when I discovered I had made a rookie error by forgetting a "#" in front of a destination label in a jump instruction. Sure enough, the very last line of code was "jmp WaitLoop", not "jmp #WaitLoop". For the most part the code work just fine with this error, but once in a while it would drift off to la la land and never come back. I'm baffled why the code works initially then seemingly at random it wigs out. It was very frustrating.

Lesson du jour: check your PASM jump destination labels!!

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-12-13 20:24
    I always do a final scan using "Find" on all the jump instructions to make sure I've included the #.

    -Phil
  • ErNaErNa Posts: 1,752
    edited 2014-12-14 03:18
    Welcome in the club! ErNa
  • AleAle Posts: 2,363
    edited 2014-12-14 03:29
    It seems that the old gotchas never go away... There is an assembler tricks and traps somewhere here, really worth a read

    Nice to "see" you again ErNa !
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-12-14 03:36
    Thats one of the nice features of bst - it gives a warning for missing #.
  • tonyp12tonyp12 Posts: 1,951
    edited 2014-12-14 08:04
    So why does not the IDE simple help you here?
    It should scan text as you type it and look for labels and if 99% of the time you should use # when it pop up a note.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-14 08:04
    Cluso99 wrote: »
    Thats one of the nice features of bst - it gives a warning for missing #.

    Hope that feature makes it into the the new software. Even better if it checks the line as it is entered.

    That has to be the mistake I make most often.
  • JDatJDat Posts: 103
    edited 2014-12-14 11:43
    Cluso99 wrote: »
    Thats one of the nice features of bst - it gives a warning for missing #.

    ... and use PASD for debugging.
Sign In or Register to comment.