fixed memory pointer wrap-under bug.
the biggest memory slot should be g_max_mem-1, not g_max_mem, and was being incorrectly set when doing `<` on a pointer of zero