ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 40

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
4.4 Arithmetic
This gives a quadruple length unsigned result Z , where Z
Z
4.4.6
Object length conversion operations are provided by the instructions listed in Table
4.7.
Section 3.1 explains that data can be represented in data objects of various sizes.
This section describes the instructions that can be used to convert between these
representations.
Most of the ST20-C1 integer arithmetic instructions operate on signed integers held in
the evaluation stack registers as 32-bit objects, and produce results in this form.
Object length conversion is important for conversion of high level language data types.
The ST20-C1 therefore provides instructions that allow a byte or half-word signed
integer to be sign extended to 32-bits by copying the sign bit to all the bits that were
previously not significant, as shown in Figure 3.2. The sign extension is performed on
the value in the Areg and the result is placed in the Areg. The other registers are not
affected.
xbword extends a signed byte to a word by copying bit 7 into bits 8 to 31. xsword
extends a signed half-word to a word by copying bit 15 into bits 16 to 31.
lsxinc loads a sixteen bit value, sign extends it to 32 bits and increments the address
by two bytes. This is the same as:
40/205
3
the most significant word of Z .
ldl X
ldl X
ldc 0; rev; ldl Z
ldl Z
Object length conversion
lsinc; xsword;
3
hi
hi
; addc; stl Z
; ldl Y
; ldl Y
lo
hi
Table 4.7 Object length conversion instructions
xbword
xsword
; umac; stl Z
; umac; rev; stl Z
Mnemonic
2
; addc; stl Z
3
1
;
2
sign extend byte to word
sign extend sixteen to word
;
3
;
Name
0
is the least significant and

Related parts for ST20-C1