Shop OBEX P1 Docs P2 Docs Learn Events
Variable alias in assembly — Parallax Forums

Variable alias in assembly

max72max72 Posts: 1,155
edited 2010-04-27 11:29 in Propeller 1
I'm using an asm object from Beau Schwabe, that offers the possibility to execute custom functions in a separate cog, at full speed.
I have many different functions, math, string handling, and so on. Every single function uses the same set of variables (named t1, t2, t3..) to get arguments, doing the job and sending back the result.
I would like to alisa the variable names to better understand the code, when writing it, and in the future.
Is it posible?
For instance can I say variable t1 can also be called angle, asciioffset, bufferaddress, and still use only one long?

Thanks in advance,
Massimo

Comments

  • Christof Eb.Christof Eb. Posts: 1,245
    edited 2010-04-27 10:17
    Hi Massimo,
    at the moment I have no example here, but this should be possible, if you place the variable in a dat section. There you can have labels (=Variable names) at the beginning of empty lines. So the adress will be the same for several variables.

    Something like this:

    Varnam1
    Varnam2
    Varnam3 long 1

    Good luck,
    Christof
  • max72max72 Posts: 1,155
    edited 2010-04-27 11:29
    Thanks!

    My code will be more readable. Well, I hope so..

    Massimo
Sign In or Register to comment.