PDA

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



HED GROUP
03-31-2009, 02:31 AM
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?

Mike Green
03-31-2009, 02:38 AM
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.

mctrivia
03-31-2009, 02:38 AM
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 (http://propmodule.com) has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.