enCoRe™ V CY7C643xx, enCoRe™ V LV CY7C604xx TRM, Document No. 001-32519 Rev *H
26
2. CPU Core (M8C)
This chapter explains the CPU Core, called the M8C, and its associated register. It covers the internal M8C registers, address
spaces,
set and formats. For additional information concerning the M8C instruction set, refer to the
PSoC
Designer Assembly Language User Guide
available at
. For a quick reference of all enCoRe V regis-
ters in address order, refer to the
Register Reference chapter on page 163
2.1
Overview
The
is a four MIPS 8-bit Harvard architecture micropro-
cessor. Selectable processor clock speeds up to 24 MHz
enable you to tune the M8C to a particular application’s per-
formance and power requirements. The M8C supports a rich
instruction set that allows for efficient low-level language
support.
2.2
Internal Registers
The M8C has five internal registers that are used in program
execution. Here is a list of these registers.
■
Accumulator (A)
■
Index (X)
■
Program Counter (PC)
■
Stack Pointer (SP)
■
Flags (F)
All the internal M8C registers are 8 bits in width, except for
the PC, which is 16 bits wide. Upon
, A, X, PC, and SP
are reset to 00h. The Flag register (F) is reset to 02h, indi-
cating that the Z
is
.
With each
operation, the SP is automatically incre-
mented or decremented so that it always points to the next
stack
in RAM. If the last byte in the stack is at address
FFh
,
the
wraps to RAM address 00h. It is the
developer’s responsibility to ensure that the stack
does not overlap with user-defined variables in RAM.
With the exception of the F register, the M8C internal regis-
ters are not accessible via an explicit register address. The
internal M8C registers are accessed using these instruc-
tions:
■
MOV A, expr
■
MOV X, expr
■
SWAP A, SP
■
OR F, expr
■
JMP LABEL
The F register is read by using address F7h in either register
bank.
2.3
Address Spaces
The M8C has three address spaces:
, and regis-
ters. The ROM address space includes the Supervisory
ROM (SROM) and the flash. The ROM address space is
accessed through its own address and
The ROM address space is composed of the SROM and the
on-chip flash program store. Flash is organized into 128-
byte blocks. Program store page boundaries are not an
issue because the M8C automatically increments the 16-bit
PC on every instruction. This makes the block boundaries
invisible to user code. Instructions occurring on a 128-byte
flash page boundary (with the exception of
JMP
instructions)
incur an extra M8C clock cycle, because the upper byte of
the PC is incremented.
The register address space is used to configure the enCoRe
Vmicrocontroller’s programmable blocks. It consists of two
banks of 256 bytes each. To switch between banks, the XIO
bit in the Flag register is set or cleared (set for Bank1,
cleared for Bank0). The common convention is to leave the
bank set to Bank0 (XIO cleared), switch to Bank1 as needed
(set XIO), then switch back to Bank0.