Data Formats - Mitsubishi Electric M32R Series User Manual

Mitsubishi 32-bit risc single-chip microcomputers
Table of Contents

Advertisement

2

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)
Rn
Sign-extended (LDH instruction) or
zero-extended (LDUH instruction)
0(MSB)
Rn
0(MSB)
Rn
<When storing>
0(MSB)
Rn
0(MSB)
Rn
0(MSB)
Rn
Figure 2.6.2 Data Formats in Register
Sign-extended (LDB instruction) or
zero-extended (LDUB instruction)
16
From memory (LD instructions)
Word
16
Word
To memory (ST instruction)
2-8
From memory (LDB,
LDUB instructions)
24
Byte
From memory (LDH, LDUH instructions)
Halfword
24
Byte
To memory (STB instruction)
Halfword
To memory (STH instruction)
CPU
2.6 Data Formats
31(LSB)
31(LSB)
31(LSB)
31(LSB)
31(LSB)
31(LSB)
Ver.0.10

Advertisement

Table of Contents
loading

Table of Contents