Top Banner
9/20/6 Lecture 3 - Instruction Set - Al 1 Exception Handling (2)
16

Exception Handling (2)

Feb 13, 2016

Download

Documents

sema

Exception Handling (2). 68000 Exception Handling. The 68000’s exception vector table. Exception vector table. 256 longwords in low memory $00 0000 to $00 03FF (1024 bytes) Allow specialized routine to handle each exception type Some 8-bit uprocessors even have a small table. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 1

Exception Handling (2)

Page 2: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 2

68000 Exception Handling The 68000’s exception vector table

Page 3: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 3

Exception vector table 256 longwords in low memory

$00 0000 to $00 03FF (1024 bytes) Allow specialized routine to handle each

exception type Some 8-bit uprocessors even have a small

table

Page 4: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 4

Exception Vector TableSystem reserves lowMemory for the table

If some vectors not used then no handler

Rather than no pointer, point to aSpurious exception handler

Page 5: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 5

How to implement it? First answer is MUST be in ROM –

1st 2 longwords are initial supervisor stack pointer and initial program counter $00 0000 to ?

These must be there on start up ROM is good as they will be there at startup ROM is also bad as not easily modified

Changes require a new ROM

Page 6: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 6

Solutions Fixed vector in ROM points to a second

vector in RAM that points to routine WHY? Not possible to get a 16 byte ROM Possibly overlay a ROM and RAM at same

addresses? When address is in range $00 0000 to $00 0007

ROM is being addressed Otherwise RAM

Page 7: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 7

Overlay scheme When reading $00 0000 or $00 0004

actually read $00 1000 or $00 1004

Page 8: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 8

Implementation of Overlay When location

$00 0000 or $00 0004 is address ROM is selected

Page 9: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 9

2nd Method – Shadow ROM RAM and ROM are located in the same

address space At startup POR* selects ROM

POR* does a reset of FF1 On Reads ROM is selected, on Writes RAM Once vector table copied FF1 is set so future

reads are from RAM

Page 10: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 10

Implementation ROM is addressed

until RAM* becomes low

After RAM* goes low the RS FF enables the RAM

RAM* would be a signal from an I/O port

Page 11: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 11

Processing an Vectored Interrupt Complete instruction

currently executing Stack PC Continue according to

protocol

Page 12: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 12

IACK cycle During IACK

device provides vector number

The exception handler starts execution

Page 13: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 13

Hardware interface of device 68000 family

peripheral having IACK input

Note that IACK has unique Function Code, FC7, i.e., 111

Page 14: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 14

Autovectored interrupt Older devices and non-family devices unable

to respond with appropriate vector number Another pin, VPA*, Valid Peripheral Address

is used to signal this. Vector numbers 25-31 are reserved for

autovectored interrupts on IRQ1* to IRQ7* Avoids having a lot of glue logic for these

older devices

Page 15: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 15

Timing of autovectored interrupts Example IRQ2* asserted Followed by VPA*

being asserted Vector 26 used to

respond Autovectored are 25 to

31 in vector table

Page 16: Exception Handling (2)

9/20/6 Lecture 3 - Instruction Set - Al 16

Autovectored Hardware System must have

vectored interrupt hw Autovectored needed

only if 6800 family peripherals used