In practice, most source code has some dependency on the system on which it is designed for—it is hard to write a large, useful program that is totally independent. When the manufacturer upgrades or supersedes that system, the code will no longer work without changes, and becomes legacy code. A large part of the task of a software engineer is altering code to continually prevent this.
While the term usually refers to source code, it can occasionally be heard applied to executable code that no longer runs on a modern version of a system, or requires a compatibility environment to do so. An example would be a classic Macintosh application which will not run natively on Mac OS X, but runs inside the Classic environment.