23.10.2013 Views

M68HC05 Family — Understanding Small Microcontrollers

M68HC05 Family — Understanding Small Microcontrollers

M68HC05 Family — Understanding Small Microcontrollers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Freescale Semiconductor, Inc...<br />

Computer Numbers and Codes<br />

Instruction Mnemonics and Assemblers<br />

Octal<br />

Freescale Semiconductor, Inc.<br />

An opcode such as $4C is understood by the CPU, but it is not very<br />

meaningful to a human. To solve this problem, a system of mnemonic<br />

instruction equivalents is used. The $4C opcode corresponds to the<br />

INCA mnemonic, which is read “increment accumulator.” Although there<br />

is printed information to show the correlation between mnemonic<br />

instructions and the opcodes they represent, this information is seldom<br />

used by a programmer because the translation process is handled<br />

automatically by a separate computer program called an assembler.An<br />

assembler is a program that converts a program written in mnemonics<br />

into a list of machine codes (opcodes and other information) that can<br />

be used by a CPU.<br />

An engineer develops a set of instructions for the computer in mnemonic<br />

form and then uses an assembler to translate these instructions into<br />

opcodes that the CPU can understand. We will discuss instructions,<br />

writing programs, and assemblers in other chapters. However, you<br />

should understand now that people prepare instructions for a computer<br />

in mnemonic form, but the computer understands only opcodes; thus, a<br />

translation step is required to change the mnemonics to opcodes, and<br />

this is the function of the assembler.<br />

Before leaving this discussion of number systems and codes, we will<br />

look at two additional codes you may have heard about. Octal (base 8)<br />

notation was used for some early computer work but is seldom used<br />

today. Octal notation used the numbers 0 through 7 to represent sets of<br />

three binary digits in the same way hexadecimal is used to represent<br />

sets of four binary digits. The octal system had the advantage of using<br />

customary number symbols, unlike the hexadecimal symbols A through<br />

F discussed earlier.<br />

Two disadvantages caused octal to be abandoned for the hexadecimal<br />

notation used today. First of all, most computers use 4, 8, 16, or 32 bits<br />

per word; these words do not break down evenly into sets of three bits.<br />

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

32 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!