23.10.2013 Views

M68HC05 Family — Understanding Small Microcontrollers

M68HC05 Family — Understanding Small Microcontrollers

M68HC05 Family — Understanding Small Microcontrollers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Freescale Semiconductor, Inc...<br />

Computer Numbers and Codes<br />

ASCII Code<br />

Computer Operation Codes<br />

Freescale Semiconductor, Inc.<br />

Computers must handle many kinds of information other than just<br />

numbers. Text (alphanumeric characters) and instructions must be<br />

encoded in such a way that the computer can understand this<br />

information. The most common code for text information is the American<br />

Standard Code for Information Interchange (or ASCII). The ASCII code<br />

establishes a widely accepted correlation between alphanumeric<br />

characters and specific binary values. Using the ASCII code, $41<br />

corresponds to capital A, $20 corresponds to a space character, etc. The<br />

ASCII code translates characters to 7-bit binary codes, but in practice<br />

the information is most often conveyed as 8-bit characters with the most<br />

significant bit equal to 0. This standard code allows equipment made by<br />

various manufacturers to communicate because all of the machines use<br />

this same code.<br />

Table 2 shows the relationship between ASCII characters and<br />

hexadecimal values.<br />

Computers use another code to give instructions to the CPU. This code<br />

is called an operation code or opcode. Each opcode instructs the CPU<br />

to execute a very specific sequence of steps that together accomplish an<br />

intended operation. Computers from different manufacturers use<br />

different sets of opcodes because these opcodes are internally<br />

hard-wired in the CPU logic. The instruction set for a specific CPU is<br />

the set of all operations that the CPU knows how to perform. Opcodes<br />

are one representation of the instruction set and mnemonics are<br />

another. Even though the opcodes differ from one computer to another,<br />

all digital binary computers perform the same kinds of basic tasks in<br />

similar ways. For instance, the CPU in the MC68HC05 MCU can<br />

understand 62 basic instructions. Some of these basic instructions have<br />

several slight variations, each requiring a separate opcode. The<br />

instruction set of the MC68HC05 is represented by 210 unique<br />

instruction opcodes. We will discuss how the CPU actually executes<br />

instructions in another chapter, but first we need to understand a few<br />

more basic concepts.<br />

<strong>M68HC05</strong> <strong>Family</strong> <strong>—</strong> <strong>Understanding</strong> <strong>Small</strong> <strong>Microcontrollers</strong> <strong>—</strong> Rev. 2.0<br />

30 Computer Numbers and Codes<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!