Need help with an NES controller code

So it looks like it reads from one controller connected to pins 2, 3, and 4. Do you have another controller connected to a different set of three pins? I don't see any code for reading a second controller.

Did you mean that when you press Down (5) and Right (7) together you are getting only Down ("AS") and not Right ("SI") or Down-Right ("LQ")? That's because the big chain of IF-ELSE will only execute the first matching option it finds. Since Down will match
"if (controllerData[5] == 0)" it will not go on to check "if (controllerData[5] == 0 && controllerData[6] == 0)" or" if (controllerData[5] == 0 && controllerData[7] == 0)".