The program will be a matter of setting the right ouput pins high. The problem arises that not all displays have the same pinouts and thus you may have to experiment with your display.
One way is to make a lookup table:
LOOKUP digit,(one,two,three,four,five,six,seven,eight,nine,zero), display
let pins = display
The data stored in the lookup table will have to be set so that it will turn the correct segments on. This whould most likely be in binary form where a 1 will represent a segment which is on and a 0 will be a segment wich is off. Thus, the number 1 with two digits on will have two "1"s and six "0"s. And 8 will have seven "1"s and one "0".
Take a look at an old post:
http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=1055&forum_id=9&Topic_Title=Help%2Bwith%2B7%2Bsegment%2Bdisplay%2Bprogram&forum_title=No+new+posts+please%21+4
ylp88