ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
17
M8C Microprocessor
The first two-byte instruction format, shown in the first row of
is used by short jumps and
calls:
CALL
,
JMP
,
JACC
,
INDEX
,
JC
,
JNC
,
JNZ
,
JZ
. This instruction format uses only four bits for the
instruction opcode, leaving 12 bits to store the relative destination address in a two’s-complement
form. These instructions can change program execution to an address relative to the current
address by -2048 or +2047.
The second two-byte instruction format, shown in the second row of
,
is used by instruc-
tions that employ the Source Immediate addressing mode (see
).
The destination for these instructions is an internal M8C register, while the source is a constant
value. An example of this type of instruction would be
ADD A, 7
.
The third two-byte instruction format, shown in the third row of
is used by a wide range of
instructions and addressing modes. The following is a list of the addressing modes that use this third
two-byte instruction format:
■
Source Direct (
ADD A, [7]
)
■
Source Indexed (
ADD A, [X+7]
)
■
Destination Direct (
ADD [7], A
)
■
Destination Indexed (
ADD [X+7], A
)
■
Source Indirect Post Increment (
MVI A, [7]
)
■
Destination Indirect Post Increment (
MVI [7], A
)
For more information on addressing modes see
.
2.4.3
Three-Byte Instructions
The three-byte instruction formats are the second most prevalent instruction formats. These instruc-
tions 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 unconditionally 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 second row of
,
is used by the fol-
lowing two addressing 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]
Table 2-6. 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
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...