This seems like the logic form @anon57585045's post #11, but with {0xFFFF plus bit-flipping} instead of {0x7FFF and no flipping}. I wasn't aware that overwriting an existing memory cell with anything else than 0xFF actually takes two writings: one to erase to 0xFF and one to write the new value. Is that correct?