Quote Originally Posted by retepsnikrep View Post
What is confusing me is why we have an EXT variable and then this huge formula in assembly. Why?
Preumably because it can't fit into 16 bit integer maths even with DIV32
In assembler on the 12F1822 do we have 32 bit maths?

Code:
Vref_AD5 CON EXT             ; Calculate FVref A/D reading when VDD = VDD_Nom
@Vref_AD5 = (_FVrefMV*100000) / (VDD_Nom*1000000/(1023 << (_VDD_Res-10)))
That formula is composed entirely of constants, and is assigned to a constant. So, it is evaluated at compile time (by your 64 bit computer) and the integer value is assigned to the the constant "Vref_AD5". For 5v it ends up being 209.