Shop OBEX P1 Docs P2 Docs Learn Events
Using labels outside assembly area region in assembly area region — Parallax Forums

Using labels outside assembly area region in assembly area region

The WangsterThe Wangster Posts: 13
edited 2007-04-07 22:23 in Propeller 1
I want to use the address of a place in hub memory (which is a label) in assembly. I have this:

DAT
alabel    word $0
...
          org
          ... some assembly code here ...

          long alabel




But Propeller tool won't let me do that. It says "address is not long". Is there a workaround for this?

Thanks.

Comments

  • KaioKaio Posts: 253
    edited 2007-04-07 22:23
    The Wangster,

    firstly, you should be to declare a variable in hub (main) memory and can do this in the VAR section.
    Secondly, you have to pass the address of this variable to your assembly code using the second parameter of cognew statement, e.g. cognew(@entry, @alabel).

    In your example code your word variable is located before the ORG statement, but I don't know how it would be handled by the compiler. You must use #alabel at long statement when you will have the address of alabel.
Sign In or Register to comment.