Zilog Z16F2810 Uživatelský manuál Strana 47

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 216
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 46
UM018809-0611 Operand Addressing
ZNEO
®
CPU Core
User Manual
31
Resizing Data
When an 8-bit or 16-bit memory location is written, the value from the source register is
truncated, so only the least-significant 8 or 16 bits of the register value are written, respec-
tively. The source register itself is not changed. When an 8-bit or 16-bit memory location
is read, the value from memory must be extended to a full 32 bits before it is used or stored
in a register.
One of the following two kinds of data extension must be used:
Unsigned (Zero) Extension. The upper bits of the new 32-bit value are filled with zeroes.
Unsigned extension is invoked by including a ‘U’ in the mnemonic suffix. For example,
the following instruction loads the byte at
FFFF_7002H into R10[7:0] and fills R10[31:8]
with zeroes:
LD.UB R10,7002H
Signed Extension.
The upper bits of the new 32-bit value are filled with ones or zeroes,
depending on the source value’s most-significant (sign) bit, to preserve the sign of the
loaded value. Signed extension is invoked by including an ‘S’ in the mnemonic suffix.
For example, the following instruction loads the byte at address
FFFF_7002H into register
bits R10[7:0] and copies bit 7 of that byte into each bit of R10[31:8].
Figure 7. Mapping of Register to Memory Bytes
Zobrazit stránku 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 215 216

Komentáře k této Příručce

Žádné komentáře