Assuming you mean 'portd.b3' instead of 'prod.b3', try changing:
Code:
while (portd.b2 == 0 && portd.b3 == 1)
to
Code:
while ((portd.b2 == 0) && (portd.b3 == 1))
by doing that you ensure that each of the tests for zero are made before it ANDs the results together.
Be careful with that code, it isn't wrong but you should remember that everything between { and } will run all the time the switches are pressed (or not). If you want to to detect a
change in the switches you should consider there is a built in 'interrupt on change' circuit that would be more useful.
Brian.