How to Write ISR function for Hardware and Software Interrupt
Pragmas are a standardized way of providing 'extra' information to your compiler, however the meaning is not defined outside the context of that particular compiler. So you need to consult the manual for the compiler to find out exactly what is going on. In this case it tells the compiler to populate the interrupt vector table entry 13 (P0INT_VECTOR is a constant defined in a header file) to point to the below routine. 

__interrupt is a keyword extension that causes the compiler to emit code to do appropriate context save and restore for an interrupt. Again, see the compiler manual.

p0_ISR is an arbitrary name with no specific meaning to the compiler.

You would write an ISR for a software interrupt the same as any other interrupt, if SWI was supported by the '51 hardware (I don't think it is)- look up the name of the constant for the vector table. 

All this stuff is very compiler- and processor-dependent so generalizations are not so useful. If you understand assembly programming for a particular processor you know what information you have to slip to the compiler for it to be able to emit correct code.

If the processor supports SWI, actually invoking a SWI might involve a keyword extension or you might have to dip into inline assembly etc.