The problem that I see is that NM is not being set to NM+1. Basically, rather than saying "PRINT?NM+1" you should do "INC NM:PRINT?NM". If you don't understand why, it's because you're passing NM+1 to print, which increments that copy of the data but not the actual thing. But I'll assume that you'll understand, and not go too far into how code works.