A subroutine was a subprogram in a computer, often called up to execute by a higher level program. It consisted of instructions that performed a specific set of tasks for a main routine. Subroutines often accounted for the sentient qualities of AI.
In late 2375, Noah Lessing of the USS Equinox designed a subroutine to mask the internal sensors of the USS Voyager, allowing the Equinox crew to steal a modified field generator that provided protection against nucleogenic lifeforms. (VOY: "Equinox")