2.1 CPU
2.1.3 Prefix codes
Placing a prefix code before an instruction partially changes the operation of the instruction. Three types of
prefix codes can be used: bank select prefix, common register bank prefix, and flag change disable prefix.
Bank select prefix
The memory space used for accessing data is determined for each addressing mode.
When a bank select prefix is placed before an instruction, the memory space used for accessing data by
that instruction can be selected regardless of the addressing mode.
Bank select prefix
Use the following instructions with care:
(1) String instructions (MOVS, MOVSW, SCEQ, SCWEQ, FILS, FILSW)
The bank register specified by an operand is used regardless of the prefix.
(2)Stack manipulation instructions (PUSHW, POPW)
SSB or USB is used according to the S flag regardless of the prefix.
(3)I/O access instructions
MOV A, io / MOV io, A /MOVX A, io / MOVW A, io /MOVW io, A / MOV io, #imm8
MOVW io, #imm16 / MOVB A, io:bp / MOVB io:bp, A /SETB io:bp / CLRB io:bp
BBC io:bp, rel / BBS io:bp, rel WBTC, WBTS
The IO space of the bank is used regardless of the prefix.
(4)Flag change instructions (AND CCR,#imm8, OR CCR,#imm8)
The instruction is executed normally, but the prefix affects the next instruction.
(5)POPW PS
SSB or USB is used according to the S flag regardless of the prefix. The prefix affects the next
instruction.
(6)MOV ILM,#imm8
The instruction is executed normally, but the prefix affects the next instruction.
(7)RETI
SSB is used regardless of the prefix.
28
Chapter 2: CPU
Table 2.1.3a Bank select prefix
PCB
DTB
ADB
Either the SSP or USP space is used according to
SPB
the stack flag value.
Space selected
PC space
Data space
AD space
MB90580 Series