Document # 001-20559 Rev. *D
39
CPU Core (M8C)
2.5.3
Three-Byte Instructions
The three-byte instruction formats are the second most
prevalent instruction formats. These instructions need three
bytes because they either move data between two
addresses in the user-accessible address space (registers
and RAM) or they hold 16-bit absolute addresses as the
destination of a long jump or long call.
The first instruction format, shown in the first row of
,
is used by the
LJMP
and
LCALL
instructions.
These instructions change program execution uncondition-
ally to an absolute address. The instructions use an 8-bit
opcode, leaving room for a 16-bit destination address.
The second three-byte instruction format, shown in the sec-
ond row of
,
is used by the following two address-
ing modes:
■
Destination Direct Source Immediate (
ADD [7], 5
)
■
Destination Indexed Source Immediate (
ADD [X+7],
5
)
The third three-byte instruction format, shown in the third
row of
,
is for the Destination Direct Source Direct
addressing mode, which is used by only one instruction.
This instruction format uses an 8-bit opcode followed by two
8-bit addresses. The first address is the destination address
in RAM, while the second address is the source address in
RAM. The following is an example of this instruction:
MOV [7], [5]
2.6
Addressing Modes
The M8C has ten addressing modes. These modes are detailed and located on the following pages:
■
■
.
■
.
■
“Destination Direct” on page 41
■
“Destination Indexed” on page 41
■
“Destination Direct Source Immediate” on page 41
■
“Destination Indexed Source Immediate” on page 42
■
“Destination Direct Source Direct” on page 42
.
■
“Source Indirect Post Increment” on page 43
.
■
“Destination Indirect Post Increment” on page 43
.
2.6.1
Source Immediate
For these instructions, the source value is stored in operand 1 of the instruction. The result of these instructions is placed in
either the M8C A, F, or X register as indicated by the instruction’s opcode. All instructions using the Source Immediate
addressing mode are two bytes in length.
Source Immediate Examples:
Table 2-5. Three-Byte Instruction Formats
Byte 0
Byte 1
Byte 2
8-Bit Opcode
16-Bit Address (MSB, LSB)
8-Bit Opcode
8-Bit Address
8-Bit Data
8-Bit Opcode
8-Bit Address
8-Bit Address
Table 2-6. Source Immediate
Opcode
Operand 1
Instruction
Immediate Value
Source Code
Machine Code
Comments
ADD
A, 7
01 07
The immediate value 7 is added to the Accumulator. The result is placed
in the Accumulator.
MOV
X, 8
57 08
The immediate value 8 is moved to the X register.
AND
F, 9
70 09
The immediate value 9 is logically AND’ed with the F register and the
result is placed in the F register.
Summary of Contents for PSoC CY8C23533
Page 4: ...Contents Overview 4 Document 001 20559 Rev D Section G Glossary 385 Index 401 ...
Page 16: ...Contents Overview 16 Document 001 20559 Rev D ...
Page 24: ...24 Document 001 20559 Rev D Section A Overview ...
Page 30: ...30 Document 001 20559 Rev D Pin Information ...
Page 54: ...54 Document 001 20559 Rev D Supervisory ROM SROM ...
Page 60: ...60 Document 001 20559 Rev D RAM Paging ...
Page 68: ...68 Document 001 20559 Rev D Interrupt Controller ...
Page 76: ...12 Document 001 20559 Rev D General Purpose IO GPIO ...
Page 82: ...18 Document 001 20559 Rev D Internal Main Oscillator IMO ...
Page 84: ...20 Document 001 20559 Rev D Internal Low Speed Oscillator ILO ...
Page 90: ...26 Document 001 20559 Rev D External Crystal Oscillator ECO ...
Page 94: ...30 Document 001 20559 Rev D Phase Locked Loop PLL ...
Page 106: ...42 Document 001 20559 Rev D Sleep and Watchdog ...
Page 228: ...164 Document 001 20559 Rev D Section D Digital System ...
Page 234: ...170 Document 001 20559 Rev D Array Digital Interconnect ADI ...
Page 278: ...214 Document 001 20559 Rev D Digital Blocks ...
Page 296: ...232 Document 001 20559 Rev D Analog Interface ...
Page 304: ...240 Document 001 20559 Rev D Analog Array ...
Page 308: ...244 Document 001 20559 Rev D Analog Input Configuration ...
Page 312: ...248 Document 001 20559 Rev D Analog Reference ...
Page 338: ...274 Document 001 20559 Rev D Section F System Resources ...
Page 354: ...290 Document 001 20559 Rev D Multiply Accumulate MAC ...
Page 374: ...310 Document 001 20559 Rev D I2C ...
Page 400: ...336 Document 001 20559 Rev D Section G Glossary ...