#if defined __PIC16F1847
    LATA = state;
#elif defined __PIC16F72
    // this device does not have a latch
    PORTA = state;
#else
    #error compiling for unrecognised device
#endif