I have some Special function registers (SFR) that need to be in volatile type. How can I do this? Because when I declare:
volatile sfr16 CAN0DAT = 0xD0;
It would not surprise me in the least if SFRs were implicitly "volatile", but I'll leave that up to you to research for a definitive answer.
"the compiler said that is wrong." How can anyone help you with this if you don't show the actual error message that you got?? Post the entire message, verbatim - use copy-and paste, do not re-type it.