The F
(ASIC). It can be widely applied from household to industrial equipment starting with portable
equipment.
This manual is intended for engineers who actually develop products using the F
microcontrollers, especially for programmers who prepare programs using the assembly
language for the F
8FX.
Note: F
■ Trademark
The company names and brand names herein are the trademarks or registered trademarks of
their respective owners.
■ Organization of This Manual
This manual consists of the following six chapters:
CHAPTER 1 OUTLINE AND CONFIGURATION EXAMPLE OF F
MC-8FX is original 8-bit one-chip microcontrollers that support application specific IC
2
MC is the abbreviation of FUJITSU Flexible Microcontroller.
This chapter outlines the F
2
MC-8FX
2
MC-8FX series assembler. It describes various instructions for the F2MC-
2
MC-8FX CPU
2
MC-8FX CPU and explains its configuration by example.
CHAPTER 2 MEMORY SPACE
This chapter explains the F
2
MC-8FX CPU memory space.
CHAPTER 3 REGISTERS
This chapter explains the F
2
MC-8FX dedicated registers and general-purpose registers.
CHAPTER 4 INTERRUPT PROCESSING
This chapter explains the functions and operation of F
2
MC-8FX interrupt processing.
CHAPTER 5 CPU SOFTWARE ARCHITECTURE
This chapter explains the instructions for the F
2
MC-8FX CPU.
CHAPTER 6 DETAILED RULES FOR EXECUTION INSTRUCTIONS
This chapter explains each execution instruction, used in the assembler, in reference format.
APPENDIX
The appendix contains instruction and bus operation lists and an instruction map.
i
• The contents of this document are subject to change without notice.
Customers are advised to consult with sales representatives before ordering.
• The information, such as descriptions of function and application circuit examples, in this document are presented solely for
the purpose of reference to show examples of operations and uses of FUJITSU semiconductor device; FUJITSU does not
warrant proper operation of the device with respect to use based on such information. When you develop equipment
incorporating the device based on such information, you must assume any responsibility arising out of such use of the
information. FUJITSU assumes no liability for any damages whatsoever arising out of the use of the information.
• Any information in this document, including descriptions of function and schematic diagrams, shall not be construed as license
of the use or exercise of any intellectual property right, such as patent right or copyright, or any other right of FUJITSU or any
third party or does FUJITSU warrant non-infringement of any third-party's intellectual property right or other right by using
such information. FUJITSU assumes no liability for any infringement of the intellectual property rights or other rights of third
parties which would result from the use of information contained herein.
• The products described in this document are designed, developed and manufactured as contemplated for general use, including
without limitation, ordinary industrial use, general office use, personal use, and household use, but are not designed, developed
and manufactured as contemplated (1) for use accompanying fatal risks or dangers that, unless extremely high safety is
secured, could have a serious effect to the public, and could lead directly to death, personal injury, severe physical damage or
other loss (i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, mass transport control,
medical life support system, missile launch control in weapon system), or (2) for use requiring extremely high reliability (i.e.,
submersible repeater and artificial satellite).
Please note that FUJITSU will not be liable against you and/or any third party for any claims or damages arising in connection
with above-mentioned uses of the products.
• Any semiconductor devices have an inherent chance of failure. You must protect against injury, damage or loss from such
failures by incorporating safety design measures into your facility and equipment such as redundancy, fire protection, and
prevention of over-current levels and other abnormal operating conditions.
• Exportation/release of any products described in this document may require necessary procedures in accordance with the
regulations of the Foreign Exchange and Foreign Trade Control Law of Japan and/or US export control laws.
• The company names and brand names herein are the trademarks or registered trademarks of their respective owners.
CHAPTER 1OUTLINE AND CONFIGURATION EXAMPLE OF F2MC-8FX CPU ........... 1
1.1Outline of F2MC-8FX CPU .................................................................................................................. 2
1.2Configuration Example of Device Using F
CHAPTER 2MEMORY SPACE ........................................................................................ 5
2.1CPU Memory Space ........................................................................................................................... 6
2.2Memory Space and Addressing .......................................................................................................... 7
2.2.1Data Area ...................................................................................................................................... 9
2.2.2Program Area .............................................................................................................................. 11
2.2.3Arrangement of 16-bit Data in Memory Space ............................................................................ 13
APPENDIX A Instruction List ...................................................................................................................... 222
A.1F
A.2Operation List ................................................................................................................................. 226
( A = "F0 63" → A = "F0 62" )
( PC = "F0 63" → PC = "F0 62" )
1766.65 PUSHW (PUSH Word Data of Inherent Register to Stack Memory)
( " Transfer the word value from the memory indicated by SP to dr. Then, subtract 2 fromthe value of SP. " →
" Subtract 2 from the value of SP. Then, transfer the word value from the memory indicated by SP to dr. " )
6.65 PUSHW (PUSH Word Data of Inherent Register to Stack Memory)
No operation
(C) ← 0
(C) ← 1
(I) ← 0
(I) ← 1 " ) is added.
The vertical lines marked in the left side of the page show the changes.
viii
CHAPTER 1
OUTLINE AND
CONFIGURATION EXAMPLE
2
OF F
This chapter outlines the F2MC-8FX CPU and explains
its configuration by example.
MC-8FX CPU
1.1 Outline of F2MC-8FX CPU
1.2 Configuration Example of Device Using F
2
MC-8FX CPU
1
2
CHAPTER 1 OUTLINE AND CONFIGURATION EXAMPLE OF F
MC-8FX CPU
1.1Outline of F2MC-8FX CPU
The F2MC-8FX CPU is a high-performance 8-bit CPU designed for the embedded control
of various industrial and OA equipment.
■ Outline of F2MC-8FX CPU
The F2MC-8FX CPU is a high-performance 8-bit CPU designed for the control of various industrial and
OA equipment. It is especially intended for applications requiring low voltages and low power
consumption. This 8-bit CPU can perform 16-bit data operations and transfer and is suitable for
applications requiring 16-bit control data. The F
8L CPU, and the instruction cycle number is shortened, the division instruction is strengthened, and a direct
area is enhanced.
■ F2MC-8FX CPU Features
The F2MC-8FX CPU features are as follows:
•Minimum instruction execution time: 100 ns
2
MC-8FX CPU is upper compatibility CPU of the F2MC-
•Memory: 64 Kbytes
•Instruction configuration suitable for controller
Data type: bit, byte, word
Addressing modes: 9 types
High code efficiency
16-bit data operation: Operations between accumulator (A) and temporary accumulator (T)
Bit instruction: set, reset, check
Multiplication/division instruction: 8 × 8 = 16 bits, 16/16 = 16 bits
•Interrupt priorities : 4 levels
2
2
CHAPTER 1 OUTLINE AND CONFIGURATION EXAMPLE OF F
MC-8FX CPU
1.2Configuration Example of Device Using F2MC-8FX CPU
The CPU, ROM, RAM and various resources for each F2MC-8FX device are designed in
modules. The change in memory size and replacement of resources facilitate
manufacturing of products for various applications.
■ Configuration Example of Device Using F2MC-8FX CPU
Figure 1.2-1 shows a configuration example of a device using the F2MC-8FX CPU.
Common pins
Figure 1.2-1 Configuration Example of Device Using F
AT
IXEP Serial port
PCSP
RPCCR
External bus control section
ALU
2
MC-8FX CPU
F
Clock generator
Timer/counter
A/D converter
MC-8FX BUS
2
F
Interrupt controller
F2MC-8FX Device
PWM
RAM
RO M
2
MC-8FX CPU
Pins inherent
to the product
Pins inherent to the product
3
CHAPTER 1 OUTLINE AND CONFIGURATION EXAMPLE OF F
2
MC-8FX CPU
4
CHAPTER 2
MEMORY SPACE
This chapter explains the F2MC-8FX CPU memory space.
2.1 CPU Memory Space
2.2 Memory Space and Addressing
5
CHAPTER 2 MEMORY SPACE
2.1CPU Memory Space
All of the data, program, and I/O areas managed by the F2MC-8FX CPU are assigned to
the 64 Kbyte memory space of the F2MC-8FX CPU. The CPU can access each resource
by indicating its address on the 16-bit address bus.
■ CPU Memory Space
Figure 2.1-1 shows the address configuration of the F2MC-8FX memory space.
The I/O area is located close to the least significant address, and the data area is arranged right above it.
The data area can be divided into the register bank, stack and direct areas for each application. In contrast
to the I/O area, the program area is located close to the most significant address. The reset, interrupt reset
vector and vector call instruction tables are arranged in the highest part.
Figure 2.1-1 F
FFFFH
0000H
2
MC-8FX Memory Space
Program area
Data area
I/O
6
CHAPTER 2 MEMORY SPACE
2.2Memory Space and Addressing
In addressing by the F2MC-8FX CPU, the applicable addressing mode related to memory
access may change according to the address.
Therefore, the use of the proper addressing mode increases the code efficiency of
instructions.
■ Memory Space and Addressing
The F2MC-8FX CPU has the following addressing modes related to memory access. ([ ] indicates one
byte):
•Direct addressing:Specify the lower 8 bits of the address using the operand. The accesses of operand
address 00
to FFH are mapped to 0080H to 047FH by setting of direct bank pointer (DP).
80
H
[Structure] [← OP code →] [← lower 8 bits →] ([← if operand available →]
•Extended addressing:Specify all 16 bits using the operand.
to 7FH are always 0000H to 007FH. The accesses of operand address
•Bit direct addressing:Specify the lower 8 bits of the address using the operand. The accesses of operand
address 00
to FFH are mapped to 0080H to 047FH by setting of direct bank pointer (DP).
80
H
The bit positions are included in the OP code.
[Structure] [← OP code: bit →] [← lower 8 bits →]
•Indexed addressing: Add the 8 bits of the operand to the index register (IX) together with the sign and
use the result as the address.
[Structure] [← OP code →] [← 8 offset bits →] ([← if operand available →])
•Pointer addressing: Use the contents of the extra pointer (EP) directly as the address.
[Structure] [← OP code →]
•General-purpose register addressing: Specify the general-p urpose registers. The register numbers are
[Structure] [← OP code: register →]
•Immediate addressing:Use one byte following the OP code as data.
[Structure] [← OP code →] [← Immediate data →]
•Vector addressing: Read the data from a table corresponding to the table number. The table numbers
are included in the OP code.
[Structure] [← OP code: table →]
•Relative addressing: Calculate the address relatively to the contents of the current PC. This addressing
mode is used during the execution of the relative jump and bit check instructions.
[Structure] [← OP code: table →] [← 8 bit relative value →]
Figure 2.2-1 shows the memory space accessible by each addressing mode.
to 7FH are always 0000H to 007FH. The accesses of operand address
H
included in the OP code.
7
CHAPTER 2 MEMORY SPACE
FFFF
H
FFD0
H
FFC0
H
H
047F
0200
H
Figure 2.2-1 Memory Space and Addressin g
Interrupt vector
CALLV table
Program area
External area
Register bank
+127 bytes
-128 bytes
0100
0000
H
Data area
H
I/O area
: Direct addressing
: Extended addressing
: Bit direct addressing
: Index addressing
: Pointer addressing
: General-purpose register addressing
: Immediate addressing
: Vector addressing
: Relative addressing
8
CHAPTER 2 MEMORY SPACE
2.2.1Data Area
The F2MC-8FX CPU data area can be divided into the following three for each purpose:
• General-purpose register bank area
• Stack area
• Direct area
■ General-Purpose Register Bank Area
The general-purpose register bank area in the F2MC-8FX CPU is assigned to 0100H to 01FFH. The generalpurpose register numbers are converted to the actual addresses according to the conversion rule shown in
Figure 2.2-2 by using the register bank pointer (RP) and the lower 3 bits of the OP code.
Figure 2.2-2 Conversion Rule for Actual Addresses of General-purpose Register Bank Area
The stack area in the F2MC-8FX CPU is used as the saving area for return addresses and dedicated
registers when the subroutine call instruction is executed and when an interrupt occurs. Before pushing data
into the stack area, decrease the contents of the 16-bit stack pointer (SP) by 2 and then write the data to be
saved to the address indicated by the SP. To pop data off the stack area, return data from the address
indicated by the SP and then increase the contents of the SP by 2. This shows that the most recently pushed
data in the stack is stored at the address indicated by the SP. Figure 2.2-3 and Figure 2.2-4 give examples of
saving data in the stack area and returning data from it.
"0""0"
"0"
"0"
"0"
"0"
R4 R3 R2 R1 R0 b2 b1 b0
"1"
Lower bits of OP code
9
CHAPTER 2 MEMORY SPACE
Figure 2.2-3 Example of Saving Data in Stack Area
Before execution
1235H
SP67HSP67H
A
ABCDH
Figure 2.2-4 Example of Returning Data from Stack Area
Before executionMEMORY
MEMORY
1235H
1234H
1233H
1232H
PUSHWA
POPW IX
After execution
1233
H
A
ABCDH
After execution
MEMORY
CDH
ABH
MEMORY
1235H
1234H
1233H
1232H
SPSP567AH
IXIXFEDCH
■ Direct Area
5678H567BH
567AH
XXXXH
5679H
DCHDCH
FEHFEH
5678H
567BH
567AH
5679H
5678H
The direct area in the F2MC-8FX CPU is located at the lower side of the memory space or the 1152 bytes
from 0000
can be used at a time by direct addressing and bit direct addressing is 256 bytes. 128 bytes of 0000
007F
to 047FH and is mainly accessed by direct addressing and bit direct addressing. The area that
H
can be used at any time as a direct area. 0080H to 047FH is a direct bank of 128 bytes × 8 and can
H
to
H
use one direct bank as a direct area by setting the direct bank pointer (DP). Conversion from the operand
address of direct addressing and bit direct addressing to the real address is done by the conversion rule
shown in Table 2.2-1 by using DP.
Access to it is obtained by the 2-byte instruction.
The I/O control registers and part of RAM that are frequently accessed are arranged in this direct area.
Table 2.2-1 Conversion Rule for Actual Address of Direct Addressing and Bit Direct
Addressing
Operand addressDirect bank pointer (DP)Actual address
00
to 7F
H
H
80H to FFH
000
001
010
011
100
101
110
111
0000H to 007F
to 00FF
0080
H
0100
to 017F
H
0180
to 01FF
H
0200
to 027F
H
to 02FF
0280
H
0300
to 037F
H
0380
to 03FF
H
0400
to 047F
H
H
H
H
H
H
H
H
H
H
10
CHAPTER 2 MEMORY SPACE
2.2.2Program Area
The program area in the F2MC-8FX CPU includes the following two:
• Vector call instruction table
• Reset and interrupt vector table
■ Vector Call Instruction Table
FFC0H to FFCFH of the memory space is used as the vector call instruction table. The vector call
instruction for the F
in the OP code and makes a subroutine call using the d ata written there as the jump address. Table 2.2-2
indicates the correspondence of the vector numbers with the jump address table.
Table 2.2-2 CALLV Jump Address Table
CALLVJump address table
#kUpper addressLower address
2
MC-8FX CPU provides access to this area according to the vector numbers included
FFCCH to FFFFH of the memory space is used as the table indicating the starting address of an interrupt or
reset Table 2.2-3 indicates the correspondence between the interrupt numbers or resets and the reference
Use the interrupt number #22 and #23 exclusively for vector call instruction, CALLV #6 and
CALLV #7
12
CHAPTER 2 MEMORY SPACE
2.2.3Arrangement of 16-bit Data in Memory Space
The F2MC-8FX CPU can perform 16-bit data transfer and arithmetic operation though it
is an 8-bit CPU. Arrangement of 16-bit data in the memory space is shown below.
■ Arrangement of 16-bit Data in Memory Space
As shown in Figure 2.2-5, the F2MC-8FX CPU treats 16-bit data in the memory as upper data if it is
written at the first location having a lower address and as lower dat a if it is writ ten at the next lo cation after
that.
Figure 2.2-5 Arrangement of 16-bit Data in Memory
Before execution MEMORY
After execution
MEMORY
MOVW ABCDH, A
ABCFHABCFH
ABCEH34HABCEH
A
1234
H
A
1234H
ABCDH12HABCDH
ABCCHABCCH
As when 16 bits are specified by the operand during the execution of an instruction, bytes are assumed to
be upper and lower in the order of their proximity to the OP code. This applies when the operand indicates
the memory address and 16-bit immediate data as shown in Figure 2.2-6.
Figure 2.2-6 Arrangement of 16-bit Data during Instruction Execution
[Example]
:
.
MOV A, 5678H ; Extended address
MOVWA, #1234H ; 16-bit immediate data
:
.
Assembled
:
.
H XX X X ; Extended address
XXXX
XXXX
H 60 5 6 78 ; 16-bit immediate data
H E4 12 34
XXXX
XXXX
H XX
:
.
The same may also apply to data saved in the stack by interrupts.
13
CHAPTER 2 MEMORY SPACE
14
CHAPTER 3
REGISTERS
This chapter explains the F2MC-8FX dedicated registers
and general-purpose registers.
3.1 F2MC-8FX Registers
3.2 Program Counter (PC) and Stack Pointer (SP)
3.3 Accumulator (A) and Temporary Accumulator (T)
3.4 Program Status (PS)
3.5 Index Register (IX) and Extra Pointer (EP)
3.6 Register Banks
3.7 Direct Banks
15
CHAPTER 3 REGISTERS
3.1F2MC-8FX Registers
In the F2MC-8FX series, there are two types of registers: dedicated registers in the CPU,
and general-purpose registers in memory.
■ F2MC-8FX Dedicated Registers
The dedicated register exists in the CPU as a dedicated hardware resource whose application is restricted to
the CPU architecture.
The dedicated register is composed of seven types of 16-bit registers. Some of these registers can be
operated with only the lower 8 bits.
Figure 3.1-1 shows the configuration of seven dedicated registers.
Figure 3.1-1 Configuration of Dedicated Registers
Initial value
FFFDH
0000
H
0000H
0000H
0000H
0000H
RPCCR
CCR: IL1, 0 = 11
Other flags = 0
RP : 00000
DP : 000
16 bits
PC
A
T
IX
EP
SP
DP
PS
Program counter: indicates the location of the stored instructions
Accumulator: temporarily stores the result of operations and transfer
Temporar y accumulator: performs operations with the accumulator
Index register: indicates address indexes
Extra pointer: indicates memory addresses
Stack pointer: indicates the current location of the top of the stack
Program status: stores register bank pointers, direct bank pointer
and condition codes
■ F2MC-8FX General-Purpose Registers
The general-purpose register is as follows:
•Register bank: 8-bit length: stores data
16
CHAPTER 3 REGISTERS
3.2Program Counter (PC) and Stack Pointer (SP)
The program counter (PC) and stack pointer (SP) are application-specific registers
existing in the CPU.
The program counter (PC) indicates the address of the location at which the instruction
currently being executed is stored.
The stack pointer (SP) holds the addresses of the data location to be referenced by the
interrupt and stack push/pop instructions. The value of the current stack pointer (SP)
indicates the address at which the last data pushed onto the stack is stored.
■ Program Counter (PC)
Figure 3.2-1 shows the operation of the program counter (PC).
Figure 3.2-1 Program Counter Operation
Before execution
H
PC
1234
■ Stack Pointer (SP)
Figure 3.2-2 shows the operation of the stack pointer (SP).
Before execution
A
1234H
SPSP
5678H
MEMORY
1234H
5679H
5678H
5677H
5676H
00H
Figure 3.2-2 Stack Pointer Operation
MEMORY
Instruction "NOP" executed
XXH
XXH
PUSHW A
After execution
PC
After execution
A
1235H
1234
5676H
MEMORY
1235H
1234H
H
5679H
5678H
5677H
5676H
XXH
00H
MEMORY
XXH
XXH
32H
12H
17
CHAPTER 3 REGISTERS
3.3Accumulator (A) and Temporary Accumulator (T)
The accumulator (A) and temporary accumulator (T) are application-specific registers
existing in the CPU.
The accumulator (A) is used as the area where the results of operations are temporarily
stored.
The temporary accumulator (T) is used as the area where the old data is temporarily
saved for data transfer to the accumulator (A) or the operand for operations.
■ Accumulator (A)
For 16-bit operation all 16 bits are used as shown in Figure 3.3-1. For 8-bit operation only the lower 8 bits
are used as shown in Figure 3.3-2.
Figure 3.3-1 Accumulato r (A) Operation (16-bit Operation)
When 16-bit data is transferred to the accumulator (A), all the old 16-bit data in the accumulator is
transferred to the temporary accumulator (T) as shown in Figure 3.3-3. When 8-bit data is transferred to the
accumulator, old 8-bit data stored in the lower 8 bits of the accumulator is transferred to the lower 8 bits of
the temporary accumulator as shown in Figure 3.3-4. Although all 16-bits are used as the operand for 16-bit
operations as shown in Figure 3.3-5, only the lower 8 bits are used for 8-bit operations as shown in Figure
3.3-6.
1234
H
5678
H
CF 1CF
ADDCW A
AA
After execution
H
1234
5678H
ADDC A
CFCF
1
A
T
68AD
5678
12ADH
5678H
H
H
0
0
18
Loading...
+ 242 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.