program works with data files larger than 0x10000

for some reason, large files were not previously programming.
this patch fixes the problem programming larger files. and adds
lots of debugging information.