Why would 6 stops on a Shimano shifter travel 7 cogs with a Shimano derailleur? I'm replacing the rear shifter on my old Kona mountain bike from the late '90's.  It has an 8-speed rear cassette with a Deore XT derailleur.  I got a basic ST-EF500 8-speed Shimano shifter/brake combo, but I was having a bear of a time indexing the gears.  After about 10 minutes of messing with it, I realized that on the large cog, the display showed gear 2.
So, I went back to the small cog and counted the stops on the way up to the large cog.  Sure enough, it was 6 steps on the shifter to travel 7 cogs from the bottom to the top (and the shifter wouldn't go further, which is probably a good thing since I don't want to shift into the spokes).  I disconnected the shifter to make sure that it actually had 8 distinct stops and wasn't defective and it functioned as advertised.
It appears, then, that a distance of 6 stops on the shifter matches nearly perfectly the distance of 7 cogs from top to bottom of the cassette even though they are both Shimano.  Is this a known thing?  Were there special narrow cassettes for mountain bikes in the '90's that I just didn't know I had?
Sounds like you bought the wrong shifter.  The &quot;ST-EF500&quot;  is available in both 7 speed and 8 speed
A 7 speed shifter has 7 resting positions, and will click 6 times across its range. ST-EF500-7R4A
Likewise, an 8 speed shifter will click 7 times.
ST-EF500-8R4A
If your cassette has 8 cogs total, then you need an 8 speed shifter.

If you're totally stuck with these parts, you could make them work somewhat by ignoring one outside cog.  The inter-gear spacing between 6/7/8 speed is the same, and the cassette gets wider as gear count increases.
Conversely, 8/9/10 speed cassettes are all the same width, but the inter-cog spacing decreases.
You could choose to disregard either the top or bottom gear, and index the other seven.  If you never spin out while riding, then exclude the smallest cog.  If you never ride up hills and need a low gear, then exclude the largest cog from indexing.
This is not an ideal solution - the correct shifter would be best.