A method for portable device memory management includes determining an operational
mode of a program configured to execute on the portable device based on validating
the presence of one or more memory markers in the memory. The one or more memory
marker includes a memory line having a predetermined length and including a data
portion and a tag. The method also includes allowing one or more commands based
on the operational mode and terminating execution of the program if at least one
but less than a predetermined number of memory markers are validly present in the memory.