next up previous contents index

[ENGN3213 Home]

Programmer's Model

    The 68000 and 5206 machines have two operating modes: supervisor mode, and user mode. The supervisor mode is reserved for operating systems and in this mode there is complete control of the hardware. User mode is for normal applications software, and there are certain restrictions on modifying certain registers and executing certain privileged instructions.

  From a programmer's point of view, a CPU is a set of registers, and a program is a sequence of operations which effects register transfers. The registers reflect the state of the CPU.

The 68000 has 8 32-bit data registers, 8 (+1) 32-bit address registers, a 32-bit program counter, and a 16-bit status register, Figure 98.  


  
Figure 98: 68000 registers.
\begin{figure}
\begin{center}
\epsfig{file=images/68k-reg.eps}\end{center}\end{figure}

The program counter stores the address of the next instruction to be fetched from memory.

The data and address registers are general purpose registers. The data registers are used to store data read in from memory (or memory-mapped i/o), or for storing the results of logical, arithmetic, or other operations. Address registers are typically used to store addresses of memory locations.

  Address register A7 is used as the stack pointer. In fact, there are two A7s, one for user mode and one for supervisor mode. Thus there is a user stack pointer USP=A7, and a supervisor stack pointer SSP=A7'. (Stacks will be discussed a bit later.)

The format of a data register is shown in Figure 99.


  
Figure 99: 68000 data register format.
\begin{figure}
\begin{center}
\epsfig{file=images/68k-reg-data.eps}\end{center}\end{figure}

  The status register stores information about the status of the CPU or information about the results of arithmetic or other operations. The format of the status register is shown in Figure 100. Details are discussed in Section 2.2 of Clements.


  
Figure 100: 68000 status register format.
\begin{figure}
\begin{center}
\epsfig{file=images/68k-reg-status.eps}\end{center}\end{figure}


next up previous contents index

[ENGN3213 Home]

ANU Engineering - ENGN3213