Yup, some black magic in conditional compilation, IFDEF, IFNDEF, #DEFINE, #UNDEFINE, to name only but those. Pretty slick and so usefull once you get the concept and play with.

Lots of great feature in asm and MPASM. If you' wanted, you may have one code template and it will fit every hardware depending how you deal with the conditional compilation. Good example, Microchip Framework. One code fits all(most) of their development boards.

On the top of your code, you provide some USER configurable setting, says regular LCD or GLCD, USB to RS232, PIC model and so forth... endless possibilities.

Pretty addictive.