Throughout the game we learn that 9S has been killed by 2E several times in the past, and each time his memories were wiped, which in turn would ''kill'' that 9S. However I have reason to believe that despite having his memory wiped several times, 9S somehow manages to remember, vaguely if not fully, his past selves, and retains his memories.
My biggest piece of evidence that points towards this can be found during the soul box sequence, shortly before the fight. As we approach the arena, 9S mentions that those are his memories, and as the cutscene starts, we get a closer look at some of those memories. Notice something out of place ? The memory where 2B is trying to help a wounded 9S atop Engels, it's not supposed to be there. During their conversation on the Bunker, 9S states that his memories are only intact up to the point just before they met up.
And while you could say that this may just be an oversight, I somehow don't think that Taro would let something that could have so much potential significance slip like that. With how much detail is put into the game, I find it extremely unlikely that the specific images in question being present is just an accident.
In addition, the amnesia quest proves that despite the E type having erased her memories, with enough references to said memories it became possible for her to regain them. I don't think it would be entirely out of the question that 9S, a highly advanced scanner model would be capable of something similar with even less to work with.
In fact, during The Memory Cage novella we learn that at one point 9S took a preemptive strike at 2B, indicating that he either somehow figured out or potentially even remembered what she had done to him.
''So why doesn't he try again during the events of the game ?''
I believe that though 9S may have these memories, they are stuffed deep into his subconscious, at least for the first half of route A/B. Throughout the events of the game, specifically after completing 2 sidequests, Amnesia and the Wandering Couple, thanks to their similarity to his scenario, he regains those past memories in full.
Shortly after, the events of the fight with with Grun result in 9S being captured by Adam. This leads us to the sequence where Adam confronts 9S about his feelings towards the world, and towards 2B.
I'm sure by this point you're tired of hearing about what the **** word may be, so I'll try to keep this short. I believe that it is both of the implied words, as if it were only one, I'd have seen no reason to censor the word. This deliberate ambiguity is there to instill the idea that 9S both partially hates and loves 2B. This internal conflict is what makes 9S so human.
I'm under the impression that by this point however, 9S has grown to fully understand the situation 2B is put in. The Memory Cage novella was likely one of the first times 2B had to execute him, and 9S had not yet realized just how much it pains 2B to do what she has to. But during the events of the game, 9S experiences how much 2B cares for his well being, going out of her way to save him even if for all she knows he was going to end up being killed by her again and reset.
Another important thing to note is his reaction towards what A2 says before their fight. If he hadn't known at this point about 2E, his reaction should've been wildly different. Yet all he replies is ''What do you know ? You don't know anything about us.'' This makes it sound like 9S has been aware of this information for quite a while.
It also adds quite a bit to the soulbox fight. He fights the black creature that tries to take away his memories. It would make sense that said black creature would turn into 2B, after all, she's the one who's been doing just that. This sequence is supposed to represent the other side of what 9S feels towards 2B, the one he knows is wrong and doesn't want to give into.
One last potential connection (though I think this one's stretching it a bit) is the nickname Nines. Seeing as they're acting like they've met for the first time during the prologue, it's safe to assume that 9S had just recently been reconstructed, and had his memories wiped. He's also with 2B for the most of Route A and B. So when he mentions that his friends call him Nines, I have to ask, what friends is he talking about ?
My idea is that this nickname comes from none other than 2B herself, likely during their very first pairing, before 2B realized she shouldn't get so attached to 9S. The way she accidentally lets it slip during the dialogue in the king's castle makes it sound like it's something she would say naturally to him at one point.
So to sum it up, my theory goes something like this :
9S is somehow capable of retrieving lost memories, but doesn't fully understand them until after the Adam fight. Due to this, he has a hard time coming to terms with his feelings towards 2B, but eventually understands the situation enough to forgive her for it and not attempt to murder his way to freedom.
TLDR: Nines needs a hug and some warm blankets.
If you took the time to read the entire post, I'd like to thank you and as a reward present you with the cutest little weapon of mass destruction you'll see in your life