View Full Version : will this put var1 into var2?

Robot Freak
05-16-2008, 02:41 AM

Does the following put the value 8 into var2?

var1 long 8
var2 long var1

I don't think so, cause it isn't working http://forums.parallax.com/images/smilies/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

Beau Schwabe
05-16-2008, 03:00 AM
var2 long 8

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

Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Robot Freak
05-16-2008, 03:05 AM
Thanks Beau,

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

I'd like to write a pattern like this:

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?

Robot Freak

Ken Peterson
05-16-2008, 03:25 AM
Have you tried using constants for what you're trying to do?


Robot Freak
05-16-2008, 03:59 AM
Aaah, thats it!

I didn't think about using constants at all.
That answers my question, thanks Ken!