The servo code didn't work

I can't help, since I have never done that port addressing stuff, but please explain what you think it does? Maybe it's doing what you expect, and that might not be what a servo expects.

I see you seem to set the pins as pwm, but servos don't use pwm in the simple Arduino sense.