Frequency Processing
Calm down.

First, use an MCU that has a well established C library available for it, then you need not worry about the limitations of '8 bits'. From a quick look, it appears that C is available for the 8051 you have chosen.

Then read up on pitch estimation, this is the wikipedia article on it.

It's usually a lot easier to develop your pitch detection algorithm on your PC, either in C, or a higher level language like python or Matlab, before porting it to the MCU.

Don't worry initially about using an algorithm that's small enough to port to the small address space of the AT89, just get something working. It's far easier to modify an existing working program, than to write one from scratch in a target size. It's far easier to compare a new approach with a working one than to try to debug it by itself.

Start small with the MCU as well. Just capture some samples, then send them to the PC for processing.

Good luck