Variable declaration with @ in C

This is to specify an absolute address to place the variable at.
From the XC8 compiler manual page 27, section 2.5.2 Absolute Addressing:

Variables and functions can be placed at an absolute address by using the __at() construct
......
2.5.2.2 DIFFERENCES
The 8-bit compilers have used an @ symbol to specify an absolute address


@ is a common non-standard extension to the C language which allows you to declare a variable at a specific address. It can be used for memory-mapped hardware registers etc. In which case the variable must also be declared volatile, so your example is incorrect.

Other compilers use something like __attribute__(section... or #pragma ..., all of it non-standard C.

The only rational reason (if any) why tool chains do this, is to enable register debugging on crappy debuggers. The non-standard syntax will ensure that the register becomes part of the linker output and debug info. Which in turn allows you to watch the register in the crappy debugger just as you can watch any other variable.

If you have a good debugger, it will have support and awareness of your specific MCU. Then you don't need non-standard crap in the C code, but you can write pure, portable standard C instead:

#define serv_ctr ( *(volatile uint8_t*)0x0002u )