Motorola M68000 User's Guide Page 177

  • Download
  • Add to my manuals
  • Print
  • Page
    / 256
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 176
Exception Processing, System Control Operations, and I/O 163
multi-user, it might not allow a user to do anything in supervisor mode.
This is not a disadvantage, but one of the intended features of the 68000
family. Unlike many microprocessors, including the 8086, the 68000 does
allow the writing and implementation of a secure multi-user operating
system. Here is how to set up an exception handler for the TRAP #0
instruction:
TRAP0V: EQU 32*4 TRAP 0 VECTOR ADDRESS
*GET INTO SUPERVISOR MODE IP NOT ALREADY IN IT
LEA T0HAND/A0 GET ADDRESS OF HANDLER
MOVE.L A0,TRAP0V STICK IN VECTOR
♦TRAP 0 HANDLER
T0HAND: MOVEM.L . ...,-(SP) SAVE REGISTERS WE USE
MOVEM (SP)+,.... RESTORE REGISTERS WE USED
RTE END WITH AN RTE
Notice that the exception handler saves and restores any registers it uses.
This is important because they are not automatically saved and restored
by the exception mechanismonly the program counter and the status
register/condition codes are. Forgetting to save and restore registers has
major consequences.
Serial I/O
In Chapter 2 the concept of memory mapped I/O was introduced.
All input/output on the 68000 is via I/O devices with control and data
registers that are present as addresses in the 68000s address space. This
has the advantage that rather than being restricted to a small number of
input/output instructions, the 68000 programmer can use any memory
reference instruction with input/output devices as well as actual physical
memory locations.
To cover the wide variety of I/O devices that can be connected
to the 68000 would take up a book in itself. Additionally, so many
system-dependent aspects of these devices would make the topic almost
limitless in scope. Instead, in order to give you an idea of how to program
an I/O device, we will take a look at one very popular I/O chip, the
MC6850 Asynchronous Communications Interface Adapter (ACIA).
Many microcomputers are equipped with serial communications in
terfaces. Your CRT terminal or printer can be connected via a serial
interface. Another popular interface is the parallel interface. The terms
Page view 176
1 2 ... 172 173 174 175 176 177 178 179 180 181 182 ... 255 256

Comments to this Manuals

No comments