Read two numbers and return a sum, in PIC24 Assembly
As @Snowbody already pointed asked, what is your code supposed to after this line:

mov W3,[W0]


It seems as though the execution of your program will fall through and re-enter the mySUB subroutine again.

To fix this...

Create a second label after the mySUB. Then, after _main is done working with the return values of mySUB, you can jmp (or whatever it is called in PIC24) to the second label that you created.

Then, execution will jump over mySUB and hit the .end pragma at the end.



Your mySUB subroutine seems to be doing more than it's job.

The very first line of this subroutine is 

mov #R0, W0


This line is moving a pointer to a memory location into W0. However, this subroutine is supposed to add numbers together. If it was meant to add numbers together and then put the result in memory, then why isn't it doing that at the end of the subroutine?

In my opinion, you should move the first line out of the subroutine and to the first line after the subroutine call (and before mov W3,[W0]).

That way, the subroutine is doing it's job of adding two numbers together, and the _main routine is doing it's job of getting two numbers added together, and then putting that sum in memroy



In the future, I recommend that you add some sort of documentation for each subroutine you have. It doesn't have to be a lot; it can be something as simple as this:

; Adds two numbers
; Input: W1, W2
; Output: W3 = W1 + W2
mySUB: ...