So what matters is - in some sense - the abstract structure of the software, not the way it's implemented in hardware. This idea has contributed to that of functionalism, one attempt to answer the question ``What is a mental state''?
One of the early replies: the identity theories. Mental states are physical states of the brain: each mental state is the same as a certain physical state or process. E.g. someone can have pain only if they have c-fibres and these are firing. However, this seems to concentrate too much on biological make-up. How could it apply to a Martian, or even to a human with a prosthetic aid which replaces part of the nervous system?
The reply to this: functionalism (Putnam). What's important is the rôle of the c-fibre firings in the organism's psychology. So Putnam compared mental states to program states in a computer. In his words, the defining feature of a mental state is certain abstract relations between it and (a) the environment; (b) other mental states; (c) the possessor's behaviour. You can find Putnam's own articles in Minds and Machines from Dimensions of Mind edited by Hook (NYUP 1960; PSY AD:H 76) and in The Nature of Mental States from Mind and Cognition: a Reader edited by Lycan (Blackwell 1990; PSY AD:L 098). The latter has a summary of the ideas on page 7. Putnam's Minds and Machines essay shows clearly that he's based his ideas on hardware/software independence. For another account, see page 23 in Microcognition: Philosophy, Cognitive Science and Parallel Distributed Processing by Clark (MIT 1989; PSY KH:C 054).
We can make this clearer with our machine-code program. We might say that at a certain point in the program (just before the 4307 instruction), our machine is in the state ``about to display the sum so far''. The essential thing about this state is that which would remain unchanged, no matter what the hardware. Consider the same program: being simulated by me; being simulated by a program running on a Mac; running on a purpose-built silicon chip. There is some sense in which, just before displaying, each program is in the same state. That's the essence of the mental state. Note that the state is partly defined by the states that can precede and follow it.
We can have different levels of functionalism. Neural functionalism says it's the input-output behaviour of the neurons, and their connectivity, which is important. Symbol-level functionalism is that it's the symbol level that's important. (This carries the assumption that there is a distinct symbol level.)