PIC18 xc8 compiler : how to resolve warning (335) unknown pragma "code"
Have you read the XC8 user's guide?  Section 5.9 deals with interrupts.

In there it states:


  The function qualifier interrupt (or __interrupt) can be applied to a C function definition so that it will be executed once the interrupt occurs. The compiler will process the interrupt function differently to any other functions, generating code to save and restore any registers used and return using a special instruction.


and:


  An interrupt function must be declared as type void interrupt and cannot have
  parameters. This is the only function prototype that makes sense for an interrupt function since they are never directly called in the source code.


It then goes on to give an example:

int tick_count;

void interrupt tc_int(void)
{
    if (TMR0IE &amp;&amp; TMR0IF) {
        TMR0IF=0;
        ++tick_count;
        return;
    }
    // process other interrupt sources here, if required
}


The compiler itself handles inserting the code into the right location in the vector table to call the ISR.

By default it uses the high priority interrupt vector.  To specify the low priority vector instead, insert the attribute low_priority:

void interrupt low_priority tc_int()