Machine code


next up previous contents
Next: The fetch-decode-obey cycle
Up: No Title
Previous: What's in a computer?
Back: to main list of student notes

Machine code

Program instructions are represented as numbers in memory. Each type of computer has its own way of encoding these: its own machine code.

Example. I'll use this in the next section.

In this example, I've allocated the first two decimal digits for the instruction part, and the last two for the ``operand'' - an address or data value needed by some instructions. When decoding the instruction, the processor has to split the first two digits off from the last two. This would be easy if it worked in decimal. However, no processors do, and an actual machine code would rely on a binary representation. For example, the first five binary digits might be reserved for the instruction part. I'm using decimal only because it's easier.


next up previous contents
Next: The fetch-decode-obey cycle
Up: No Title
Previous: What's in a computer?
Back: to main list of student notes



Jocelyn Ireson-Paine
Wed Feb 14 23:46:11 GMT 1996