Shop OBEX P1 Docs P2 Docs Learn Events
How Can I Asing more than 1 byte to a ymbol (NOT an Array) — Parallax Forums

How Can I Asing more than 1 byte to a ymbol (NOT an Array)

HED GROUPHED GROUP Posts: 15
edited 2009-03-30 18:38 in Propeller 1
Hi this time my question is the following:

How can I asign more than ome byte in· run time to a symbol ex:

value := string("·· ")
t := strsize

In this case value should have 3 bytes asigned

How can I do the same without using the string command?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-30 18:38
    value := string(" ") assigns the address of the string, not the value of it.

    You can assign 3 characters like this: value := constant("A" | ("B" << 8) | ("C" << 16))

    This puts the "A" as the first byte (lowest in memory) and a zero value as the last byte (highest in memory) in the LONG variable 'value'.

    If you call 'dsp.str(@value)', then you'll see the characters "ABC" on the display. STRSIZE(@value) would be 3.
  • mctriviamctrivia Posts: 3,772
    edited 2009-03-30 18:38
    you can use a dat section

    DAT
    value byte 32,32,32,0

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
Sign In or Register to comment.