Promotional modifiers "promote" a value (for example, a byte varaible) to a word or long word value. For example
- Code: Select all
Dim array(8) As Byte
Dim value As array(0).AsUInteger
value = &H01020304
It was originally intended for fast access to blocks within an array. In the example above, array(0) <= 4, array(1) <= 3 and so on.
There is one caveat though when using 16 bit parts. Word and long word data access
must fall on even address values. If the start of a byte array "falls" on an odd address value, the compiler will generate an error, as it cannot move a long word value to an odd address. Promotional modifiers can still be useful and you should not have any difficulty with promoting word types. However, this feature was left in the compiler when Firewing was targeting 8 bit devices. If writing new code for 16 parts, I would personally not use this particular feature.