ASM 698/699 Overwrite or transference (Spoilers for those who haven't read)
One thing that's bothered me about these two issues is that it's mentioned several times that there is an overwrite of brain patterns from Ock to Peter and vice versa. That suggests to me that the original patterns are still there for each, hence, the memories that either can apparently access on the other, but are being controlled by the overwriting (overriding?) patterns. So Ock and Peter only think they've switched bodies, but are actually being controlled by the new brain waves. In this way, Doc Ock gets the illusion of victory and the satisfaction of seemingly watching his greatest nemesis die, although in reality, he is just shielding himself from his own death.
I am not sure, but it seems more to me like it was a soul/personality transfer. And they are able to access the memories of their now current bodies mainly due to memories being stored electro-chemically in the brain. The memories physically exist there. Their soul/personality has all their original memories due to it being the result of experiencing them first-hand. No need for an active memory search for them to know themselves. And then as they actively try to "remember" a detail, or they see something that sparks a "memory" for that body, that is what we are seeing as these flashes from the body's past. Like Aunt May talking about doing the nasty with Doc Ock. So each now has all the memories of each other up until the transfer. But they remember themselves a bit more instinctively than they do for the body where they now are living. And, I suppose, if this lasts for any great length of time, that the lines between the characters will blur as they become more accustomed to where they are now. As well as those shared memories possibly fading quickly if/when Peter manages to switch back to his own body (and Ock to his) come ASM #700, since they won't be in direct physical contact with those electro-chemical memory "files" any longer.
Again, I am not sure. This is just me no-prizing an explanation for what I have read so far.