Shop OBEX P1 Docs P2 Docs Learn Events
Setting DAT values — Parallax Forums

Setting DAT values

BeanBean Posts: 8,129
edited 2010-04-07 13:45 in Propeller 1
In PASM if you have:

value1··· LONG 1024
value2··· LONG value1

It sets value2 to the ADDRESS of value1, not it's value. Is there any way to get the value ? Some kind of prefix or something ?

Bean


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information

Comments

  • RaymanRayman Posts: 14,885
    edited 2010-04-07 13:18
    I was caught by that once before too...
    I don't think there is any way to do it...

    I just use the CON section to make constant parameters for the DAT section...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-07 13:45
    The value of any label like "value1" or "value2" in PASM is always its address in the cog. As Rayman mentioned, you can explicitly define a label to have any value by using a CON section. You can't get the content of a memory location at compile/assembly time. The compiler/assembler doesn't keep that information around. It generates the data into the object file and that's that.
Sign In or Register to comment.