English
Language : 

32171 Datasheet, PDF (52/772 Pages) Renesas Technology Corp – 32-BIT RISC SINGLE-CHIP MICROCOMPUTER M32R FAMILY / M32R/ECU SERIES
2
CPU
2.6 Data Formats
2.6.2 Data Formats
(1) Data formats in register
Data sizes in M32R registers are always words (32 bits).
When loading byte (8-bit) or halfword (16-bit) data from memory into a register, the data is sign-
extended (LDB, LDH instructions) or zero-extended (LDUB, LDUH instructions) into word (32-bit)
data before being stored in the register. When storing data from M32R register into memory, the
register data is stored in memory in different sizes depending on the instructions used. The ST
instruction stores the entire 32-bit data of the register, the STH instruction stores the least
significant 16-bit data, and the STB instruction stores the least significant 8-bit data.
<When loading>
0(MSB)
From memory (LDB,
Sign-extended (LDB instruction) or LDUB instructions)
zero-extended (LDUB instruction) 24
31(LSB)
Rn
Byte
Sign-extended (LDH instruction) or
zero-extended (LDUH instruction)
From memory (LDH, LDUH instructions)
0(MSB)
16
31(LSB)
Rn
Halfword
0(MSB)
Rn
From memory (LD instructions)
Word
31(LSB)
<When storing>
0(MSB)
Rn
24
31(LSB)
Byte
0(MSB)
Rn
To memory (STB instruction)
16
31(LSB)
Halfword
0(MSB)
Rn
To memory (STH instruction)
31(LSB)
Word
To memory (ST instruction)
Figure 2.6.2 Data Formats in Register
2-8
32171 Group User's Manual (Rev.2.00)