
24 Assembly Language Programming for the 68000 Family
user/supervisor mode information on every reference to memory. If the
system is so designed, certain areas of memory can be restricted to ref
erences only when in the supervisor mode. If a user mode instruction
were to try to access this “protected” area of memory, a special condi
tion or “exception” would occur and the operating system could then take
control before any damage is done.
The CPU Registers
In one sense, a register is a type of memory location. However, it is
located right on the CPU chip itself. Registers differ from conventional
memory locations in that they operate at a higher speed. In other words, if
we use registers in a calculation, it will be faster to perform than if mem
ory locations were used. Additionally, registers are specified by special
names rather than just by numbers. The existence of a good register set
is a major asset to the architecture of a particular microprocessor. The 68000
family is a good example of a microprocessor with a rich register set.
Depending on whether a program is running in user or supervisor
mode, there is a slightly different view of the CPU registers. This view
is known as the programmer s model. The following paragraphs discuss
the programmers model for the user mode.
The 68000 has sixteen 32-bit general-purpose registers. These are di
vided into two groups of eight. The eight data registers, DO through D7,
are the registers you would normally use to perform arithmetic oper
ations. These can be used as bytes, words, or longwords. The second
group of eight general-purpose registers are the address registers, A0
through A7. These registers can be used for arithmetic operations, but
are primarily designed for use in the special addressing modes discussed
in subsequent chapters. The address registers can be used as words or
longwords, but not as bytes. In the next chapter you will learn more of
the details concerning the use of the sixteen general-purpose registers.
Address register A7, also known as the user stack pointer (USP), has a
special interpretation by the 68000. Some instructions affect this register
without its being explicitly specified. You will learn all about stacks and
the use of the USP in Chapter 7. For now, consider it as just one of the
eight address registers.
Another very important register is the program counter, or PC. This
32-bit register is used to hold the memory address of the next instruction
that the CPU will execute. The programmer never explicitly references
this register; its contents are always updated by the CPU. Normally, the
PC advances as the program executes sequential instructions that are in
Kommentare zu diesen Handbüchern