In 1990, the Supreme Court ruled that software was, indeed, patentable, but only in the context of some mechanical entity, whether it be a steel plant, a computer system or even (unbelievably) a CD-ROM disc.
FORBES: The Big Fix #3: How To Untangle The Mess With Software Patents