EasyManua.ls Logo

ZiLOG eZ80 User Manual

Default Icon
411 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #55 background imageLoading...
Page #55 background image
eZ80
®
CPU
User Manual
UM007714-0908 Illegal Instruction Traps
46
Illegal Instruction Traps
The eZ80
®
CPU instruction set does not cover all possible sequences of binary values.
Binary values and sequences for which no operation is defined are illegal instructions.
When an eZ80
®
processor fetches one of these illegal instructions, it performs a TRAP
operation.
While not a true eZ80
®
instruction, a TRAP operation functions similar to an
RST
00h
instruction. The function of the TRAP instruction is displayed in the following code
segment:
if ADL mode (ADL = 1) {
(SPL) PC[23:0]
if MIXED MEMORY mode (MADL = 1) {
(SPL) 03h
}
PC[23:0] 000000h
}
else Z80 mode (ADL = 0){
SPS PC[15:0]
if MIXED MEMORY mode (MADL = 1) {
(SPL) 02h
}
PC[15:0] 0000h
Effectively, PC[23:0] = {MBASE, PC[15:0]}.
The current program counter is pushed onto the stack (the stack is either SPL or SPS
depending upon the current memory mode). In addition, if the program code is written for
MIXED MEMORY mode (MADL = 1), the current memory mode information is also
pushed onto the stack.
The memory mode suffixes (
.SIS
,
.SIL
,
.LIS
, and
.LIL
) do not guarantee illegal instruc-
tion traps, even when used with instructions for which they have no meaning. For exam-
ple, preceding a Complement Carry Flag instruction (CCF) with an .SIS suffix of opcode
40h is allowed. The memory mode suffixes configure the CPU to act in a particular mem-
ory mode and fetch a particular number of bytes from the opcode stream, if necessary.
Because the CCF instruction is not affected by the current memory mode and does not
fetch any operands, there is no effect. The memory mode opcodes do not generate traps
because they do not push into secondary pages of the opcode tables, which may contain
undefined binary values.
Some products that employ the CPU can also contain a TRAP register for capturing the
illegal binary value. Refer to the eZ80
®
and eZ80Acclaim!
®
product specifications for
more information.
Question and Answer IconNeed help?

Do you have a question about the ZiLOG eZ80 and is the answer not in the manual?

ZiLOG eZ80 Specifications

General IconGeneral
CPU FamilyeZ80
CoreeZ80
Architecture8-bit
Clock Speedup to 50 MHz
Addressable Memory16 MB
Register Size8-bit
Serial InterfacesUART, SPI, I2C
Operating Temperature-40°C to +85°C
Instruction SetZ80 compatible
On-Chip Flash MemoryUp to 256 KB
On-Chip SRAMUp to 16 KB
Operating Voltage3.0V to 3.6V
Package TypesLQFP, QFP
TimersMultiple timers/counters
Power ConsumptionLow power

Summary

Introduction

Architectural Overview

Memory Modes

Z80 MEMORY Mode

Describes Z80-compatible addressing with 16-bit registers and default operating mode on reset.

ADL MEMORY Mode

Explains ADL mode utilizing 16MB linear addressing and 24-bit registers.

Registers and Bit Flags

eZ80® CPU Working Registers

Details the two banks of working registers: main and alternate.

eZ80® CPU Control Register Definitions

Lists registers controlling CPU operation: I, IX, IY, MBASE.

eZ80® CPU Registers in Z80 Mode

Details CPU registers and bit flags when operating in Z80 mode.

Memory Mode Switching

Mixed-Memory Mode Applications

Interrupts

eZ80® CPU Response to a Nonmaskable Interrupt

Details how the CPU accepts and responds to nonmaskable interrupts (NMIs).

eZ80® CPU Response to a Maskable Interrupt

Describes how the CPU responds to maskable interrupts using Interrupt Modes 0, 1, and 2.

I/O Space

Addressing Modes

CPU Instruction Set

Related product manuals