|
This program begins at address 0 and references memory locations by giving their absolute addresses. If this program had to be moved to another place in memory, many instructions would have to be modified. This may seem like an easy task for a computer, which never gets bored by mindless, repetitive tasks. However, the computer does not really see STD or ADD or NUM in memory; all it sees are binary numbers. Stored program computers cannot distinguish between instructions and data in memory. The only way the computer knows that the user intends 4 to be a SUB instruction is because the PC happened to contain the address of the word with 4 in it and the instruction decoder sees a 4 in the opcode field. When programs go awry and branch into data sections, as can easily happen, there is nothing to keep the computer from interpreting a sequence of data values as a program. |