Combine sugar, flour, milk, and chopped up chocolate in 2 quart saucepan. Stirring constantly, cook over medium heat until mixture begins to bubble. Continue stirring for 2 minutes.
Mix a little of the hot mixture into the egg yolks, beating rapidly to avoid cooking the yolks. Stir the warm yolk mixture into the remainder of the chocolate mixture, and cook for an additional 90 seconds.
Remove from heat, and stir in butter or margarine and vanilla.
Pour filling into pie shell, and chill until set.
Top with whipped topping, and a little grated chocolate.