Prev | Current Page 96 | Next

Carl Reynolds and Paul Tymann

"Schaum's Outline of Principles of Computer Science"


The third and fourth bytes together comprise the number to add; if you evaluate the binary value of those bits,
you will see that the value is 40.
To look at the content of a computer word, you cannot tell whether the word contains an instruction or
a piece of data. Fetched as an instruction, the bit pattern above means add 40 to the DX register. Retrieved as
an integer, the bit pattern means 29,491,240. In the Intel architecture, instructions (???code???) are stored in a separate
section of memory from data. When the computer fetches the next instruction, it does so from the code section
of memory. This mechanism prevents a type of error that was common with earlier, simpler computer architectures,
the accidental execution of data, as if the data were instructions.
Here is an example JMP instruction. This says, ???Set the program counter (transfer control) to address
20,476 in the code:???
11101001 11111100 01001111
The first byte is the op-code for JMP direct (meaning the address provided is where we want to go, not a
memory location holding the address to which we want to go). The second byte is the low-order byte for the
address to which to jump. The third byte is the high-order byte for the address! How odd is that, you may think?
To get the proper address, we have to take the two bytes and reorder them, like this:
01001111 11111100
This ???peculiarity??? is due to the fact that the Intel processor line is historically ???little endian.


Pages:
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
teksty piosenek Grossbritannien - Hotels weltweit włatcy móch programy teksty piosenek