You can do it with an array.
Code:
year var byte[4]
year[0] = 9
year[1] = 0
year[2] = 0
year[3] = 2
Or, if it suits you, you could do:
Code:
year var byte[2]
year[0] = 9
year[1] = 20
With the second, you would save a few bytes, but you would have to add in a zero for display purposes, so I guess you would not save anything.
You could also do it with:
Code:
year var word
year = 2009
This would save you the space, and look a little cleaner.
On the last one, if you wanted to get the digits separately, you can use:
yeardigitone = year DIG 0 (would be 9)
yeardigittwo = year DIG 1 (would be 0)
etc. This will fetch the digit (DIG) specified.
Bookmarks