Assembler (Fasm911) - Fujitsu FR60 Hardware Manual

Hide thumbs Also See for FR60:
Table of Contents

Advertisement

2.2.2

Assembler (fasm911)

Note the following points regarding the little-endian area when programming with the
FR assembly language:
■ Sections
Since the main purpose of the little-endian area is to exchange data with little-endian system CPUs, define
the little-endian area as a data section without initial values.
Access by the MB91101 will be unpredictable if a code, stack, or data section with initial values is
specified in the little-endian area.
Example:
■ Accessing Data
When data in the little-endian area is accessed, the data values can be coded without having to take the byte
ordering into consideration.
However, when accessing data in the little-endian area, access it using the data size.
Example:
The data values will be unpredictable if the MB91350A model type is used to access data using a size that
is not the data size. For example, the data values will be unpredictable if a 32-bit access instruction is used
to access two consecutive 16-bit data items at one time.
/* Correct section definitions of the little-endian area */
.SECTION Little_Area, DATA, ALIGN=4
Little_Word:
.RES.W 1
Little_Half:
.RES.H 1
Little_Byte:
.RES.B 1
LDI
#0x01020304, r0
LDI
#Little_Word, r1
LDI
#0x0102, r2
LDI
#Little_Half, r3
LDI
#0x01, r4
LDI
#Little_Byte, r5
/* Using the ST instruction (or LD instruction) to access 32-bit data*/
ST
r0, @r1
/* Using the STH instruction (or LDH instruction) to access 16-bit data*/
STH
r2, @r3
/* Using the STB instruction (or LDB instruction) to access 8-bit data*/
STB
r4, @r5
41

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb91350a series

Table of Contents