Shop OBEX P1 Docs P2 Docs Learn Events
will this put var1 into var2? — Parallax Forums

will this put var1 into var2?

Robot FreakRobot Freak Posts: 168
edited 2008-05-15 20:59 in Propeller 1
Hello,

Does the following put the value 8 into var2?
DAT
var1    long 8
var2    long var1



I don't think so, cause it isn't working smile.gif
Any idea's how I could do something like this, without using SPIN or asm to copy the values?

Kind regards,
Robot Freak

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2008-05-15 20:00
    DAT
    var1    
    var2    long 8
    
    



    This points both var1 and var2 to the same address.... This is handy for aliasing variables

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Robot FreakRobot Freak Posts: 168
    edited 2008-05-15 20:05
    Thanks Beau,

    But not exactly what I mean.
    I'll explain further.

    I'd like to write a pattern like this:
    DAT
      pattern  long  var4, var2, var3, var1
    


    Or in a different order if necessary. The values of var1..4 are not logical, so hard to write a long sequence when you've got to paste the real value each time.
    Is there a way like (or similar) to what I mean?

    Thanks,
    Robot Freak
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-05-15 20:25
    Have you tried using constants for what you're trying to do?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Robot FreakRobot Freak Posts: 168
    edited 2008-05-15 20:59
    Aaah, thats it!

    I didn't think about using constants at all.
    That answers my question, thanks Ken!
Sign In or Register to comment.