routine

term used in computer science: either program or subprogram