On a side note, this pic has an 8 level stack. I only counted 2 nested GOSUBS max. I guess 2 was 2 much...
pbp uses 4 of them before your code even starts

now see what happens when
num_digits con 5 is changed

try 4 up to 9 or beyond

also try changing
msd_limit con 5

to other values


also hold switch down for a couple of seconds