beautypg.com

9 prefix codes, Prefix codes – FUJITSU F2MCTM-16LX User Manual

Page 64

background image

48

CHAPTER 2 CPU

2.9

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.

Table 2.9-1 lists the bank select prefixes and the corresponding memory spaces.

Use the following instructions with care:

String instructions (MOVS, MOVSW, SCEQ, SCWEQ, FILS, FILSW)

The bank register specified by an operand is used regardless of the prefix.

Stack manipulation instructions (PUSHW, POPW)

SSB or USB is used according to the S flag regardless of the prefix.

I/O access instructions

MOVA,io/MOVio,A/MOVXA,io/MOVWA,io/MOVWio,A/MOVio,#imm8

MOVWio,#imm16/MOVBA,io:bp/MOVBio:bp,A/SETBio:bp/CLRBio:bp

BBCio:bp,rel/BBSio:bp,rel/WBTC,WBTS

The IO space of the bank is used regardless of the prefix.

Flag change instructions (AND CCR,#imm8, OR CCR,#imm8)

The instruction is executed normally, but the prefix affects the next instruction.

POPW PS

SSB or USB is used according to the S flag regardless of the prefix. The prefix affects the next instruction.

Table 2.9-1 Bank Select Prefix

Bank select prefix

Selected space

PCB

PC space

DTB

Data space

ADB

AD space

SPB

Either the SSP or USP space is used according to the stack flag value.