3 DATA FORMATS
3-2
EPSON
S1C17 FAMILY S1C17 CORE MANUAL
3.1.3 16-Bit Transfer (Register
→ Register)
Example: ld
%rd,%rs
X
%rs
23
16 15
16-bit data
0
23
16 15
16-bit data
0
%rd
0
Figure 3.1.3.1 16-Bit Transfer (Register
→ Register)
Bits 23–16 in the destination register are set to 0x00.
3.1.4 24-Bit Transfer (Register
→ Register)
Example: ld.a
%rd,%rs
%rs
23
24-bit data
0
23
24-bit data
0
%rd
Figure 3.1.4.1 24-Bit Transfer (Register
→ Register)
3.2 Data Formats Handled in Operations Between Memory and
a Register
The S1C17 Core can handle 8-, 16-, and 32-bit data in memory operations. In this manual, data sizes are expressed
as follows:
8-bit data
Byte, B, or b
16-bit data
Word, W, or w
32-bit data
Address data, A, a
Data sizes can be selected only in data transfer (load instruction) between memory and a general-purpose register.
In an 8-bit data transfer with a general-purpose register as the destination, the data is sign- or zero-extended to 16
bits before being loaded into the register. Whether the data will be sign- or zero-extended is determined by the load
instruction used.
In a 16-bit or 8-bit data transfer using a general-purpose register as the source, the data to be transferred is stored in
the low-order 16 bits or the low-order 8 bits of the source register.
Memory is accessed in little endian format one byte, 16 bits, or 32 bits at a time.
If memory is to be accessed in 16-bit or 32-bit units, the specified base address must be on a 16-bit boundary (least
significant address bit = 0) or 32-bit boundary (2 low-order address bits = 00), respectively. Unless this condition is
satisfied, an address-misaligned interrupt is generated.
Byte 3
8-bit data
31
24
Byte 2
23
0x00
24 23
16
Byte 1
15
8
Byte 0
7
0
Word 1
16-bit data
31
16
Word 0
15
0
Address data
32-bit data
31
0
Figure 3.2.1 Data Format (Little Endian)
Handling the eight high-order bits during 32-bit accesses
During writing, the eight high-order bits are written as 0. During reading from a memory, the eight high-order
bits are ignored. However, the eight high-order bits are effective as the PSR value only in the stack operation
when an interrupt occurs.
The data transfer sizes and types are described below.