Method of programming an electrically alterable nonvolatile memory