Shop OBEX P1 Docs P2 Docs Learn Events
(New trap in propeller assembly) Not a trap, Just a typo — Parallax Forums

(New trap in propeller assembly) Not a trap, Just a typo

stevenmess2004stevenmess2004 Posts: 1,102
edited 2008-03-15 08:55 in Propeller 1
If you do this
DAT
org 0
'...some code
aLabel
     MOV 0,0
anotherLabel
     MOV 0,0

org aLabel
:otherLabel
    MOV 0,0
    MOV 0,0
    MOV 0,0
    JMP #:otherLabel


The compiler complains that it can't find otherLabel at the JMP line. I presume that this is because anotherLabel breaks it up into a different section. Just something to watch out for if you are doing overlays.

Post Edited (stevenmess2004) : 3/15/2008 8:58:52 AM GMT

Comments

  • cgraceycgracey Posts: 14,133
    edited 2008-03-15 07:27
    Steven,

    This seems to compile fine. And it looks fine, too. I'm using version 1.05.8.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-15 07:59
    Sorry Chip,
    I tried to cut it down to something simple and didn't check it...

    Anyway, this file shows the problem. Right down near the bottom there is a line with the label :loop1 and a bit further down there is a JMP that calls it. If you remove the ':' it works.

    I'll try and see if I can find a smaller example or cut this down to the smallest thing that causes the error. I had to add the .txt to upload the file.

    Post Edited (stevenmess2004) : 3/15/2008 8:04:48 AM GMT
  • cgraceycgracey Posts: 14,133
    edited 2008-03-15 08:42
    Oh, I found it!

    You meant to type "if_nz", but you typed "in_nz", which was interpreted as a non-local label:


    ······················· ADD···· loopC1,#1
    ······················· CMP···· loopC1,#12····· wz
    ······· in_nz·········· JMP···· #:loop1

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-15 08:55
    Thanks for that Chip. Sorry to cause you the trouble. Next time I'll check more carefully before posting something.

    Edit: Hey Chip, for the propeller II can you add a feature to the compiler so that it knows what you meant to type and not what you actually typed? smile.gif

    Post Edited (stevenmess2004) : 3/15/2008 9:02:05 AM GMT
Sign In or Register to comment.