Hello Group, I like to include somewhere in my code some values that resemble the compile date and are accessible as numbers. Moreover having them coded as BCD numbers in order to convert them on a different place to (day-)date again simply by displaying these numbers as Hex-bytes.
So i do sth. like verid.CompileDay = _BCD(DAY); verid.CompileMonth = _BCD(MONTH+1); and some more lines that handle the YEAR etc. which consists of #define _BCD(x) (((x)/10) * 6 + (x)) and #define DAY(d) (( __DATE__[4] == ' ' ? 0 : __DATE__[4] - '0') * 10 + ( __DATE__[5] - '0')) and MONTH being a much more complicated define i will omit here. But he resulting compiler output (lst-file) consists of several complicated shift and add operations that tell me the precompiler did not completely evaluated the expression - which should be a const for the moment of compilation. How can i tell the precompiler to completely eval that expression and output sth. like mov.b #36, 21(r1) with 36 == 0x24 as the 24. Day of a month for example. Not that i'm unhappy with the results of the preset state but spending sth. >540 bytes to this purpose is a bit too much ado for sth. that could be basically done in a handful of move instructions (i.e. sth. smaller than 64 bytes). Any ideas? Regards, Helmut
