Since we have to play 20 questions here...

Do you have any Assembly instructions in your code?

Adding a variable might move something to a different bank than the program is expecting.
<br>