Actually I am loading the result, I just forgot to type it here.
I want to help, but it's very difficult without knowing what's actually in your code.
If 'sta wiper' is immediately followed by 'sta test' in the interrupt routine then both variables
must be updating to the same number. You say that "test" is not used anywhere else, but if it is reverting back to its original value then some other part of your code must be affecting it. Without seeing that code I can only guess what might be causing the problem.
As far as I can tell there is only one "main" and one MCUinit file.
The compiler or assembler should ensure that this code is only included once, but a bug could cause some of it to be executed more than once. Is your main code written in C, or assembler? If it's C then most obvious errors should be flagged by the compiler, but you must be careful when interfacing to assembler code. If it is all assembly code then any little mistake could be fatal. In either case it may help to have another pair of eyes look over your code.
It acts like there is another routine that is actually running.
Interrupts occur asynchronously relative to your main code, which can cause problems with shared variables because they can change
at any time. Disable all code (including interrupts) except the minimum required to update "test". If that works then re-enable the other code bit by bit, until it fails. Then examine that last bit to see what it is doing wrong. If you can't get it to work
at all then you have a more fundamental error.