Re:Preprocessor calculation of constants
That's psuedo code - I'm not co-located with the actual code at this moment. By the way, in addition to inspecting the assembly and seeing a zero being moved into the register, I also added debug code like this:
r_bat = d;
Then, examing r_bat in the debugger, I could see it's value was 0.