Shop OBEX P1 Docs P2 Docs Learn Events
Assembly Question: No constant symbol equates? — Parallax Forums

Assembly Question: No constant symbol equates?

RaymanRayman Posts: 14,162
edited 2007-09-27 15:46 in Propeller 1
Maybe I'm missing something, but how can I define a constant number to a symbol so that I can use it over and over without using any memory?

Know what I mean?· With a different MCU, I'd use a compiler directive like:

ThisConstant EQU 5

and then I could use it like this:

ADD A,#ThisConstant

It appears to me that this doesn't exist with this compiler.· Am I wrong?· In the examples I've seen, people are doing:

ThisConstant LONG 5

This does the same thing, but uses up memory...

Comments

  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-09-27 15:14
    Declare it in the CON section just as you define _xinfreq etc.

    Graham
  • RaymanRayman Posts: 14,162
    edited 2007-09-27 15:45
    Thanks. I've only seen the CON section described in terms of SPIN, so I didn't think it would apply to the DAT section. But, it seems to work...
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-09-27 15:46
    Yeah, I knew that honest [noparse]:)[/noparse]
Sign In or Register to comment.