Hello again. Sorry for error in previous posting . Below is correct version . > Below the macros MCALL to auto switch according bits in PCLATH register. > If ROUTINE addr and PCLATH bits have the same value this macros don't > perform any dump bit switching . This macros not been tested, so any > comment > welcome . The MGOTO macros have the same structure and principle . ---cut--- PAGE_BITS EQU H'18' PAGE_BIT_1 EQU H'10' PAGE_BIT_0 EQU H'08' LAST_ADDR SET 0 MCALL macro ROUTINE LOCAL C_LABEL, PCLATH_MASK PCLATH_MASK SET ( high ( C_LABEL ^ ROUTINE) ) & PAGE_BITS if ( ( PCLATH_MASK & PAGE_BIT_1 ) == PAGE_BIT_1 ) if ( ( LAST_ADDR & PAGE_BIT_1 ) == PAGE_BIT_1 ) BCF PCLATH,4 else BSF PCLATH,4 endif endif if ( ( PCLATH_MASK & PAGE_BIT_0 ) == PAGE_BIT_0 ) if ( ( LAST_ADDR & PAGE_BIT_0 ) == PAGE_BIT_0 ) BCF PCLATH,3 else BSF PCLATH,3 endif endif LAST_ADDR SET PCLATH_MASK & ( high ROUTINE ) C_LABEL SET $ CALL ROUTINE endm ---cut--- > One comment from me - LAST_ADDR must be global value. > > WBR Dmitry.