MSP430 Instructions
4-110
16-Bit MSP430X CPU
SXT
Extend sign
Syntax
SXT
dst
Operation
dst.7
→
dst.15:8, dst.7
→
dst.19:8 (Register Mode)
Description
Register Mode: the sign of the low byte of the operand is extended into the bits
Rdst.19:8
Rdst.7 = 0: Rdst.19:8 = 000h afterwards.
Rdst.7 = 1: Rdst.19:8 = FFFh afterwards.
Other Modes: the sign of the low byte of the operand is extended into the high
byte.
dst.7 = 0: high byte = 00h afterwards.
dst.7 = 1: high byte = FFh afterwards.
Status Bits
N:
Set if result is negative, reset otherwise
Z:
Set if result is zero, reset otherwise
C:
Set if result is not zero, reset otherwise (C = .not.Z)
V: Reset
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
The signed 8-bit data in EDE (lower 64 K) is sign extended and added to the
16-bit signed data in R7.
MOV.B
&EDE,R5
; EDE -> R5. 00XXh
SXT
R5
; Sign extend low byte to R5.19:8
ADD
R5,R7
; Add signed 16-bit values
Example
The signed 8-bit data in EDE (PC
±
32 K) is sign extended and added to the
20-bit data in R7.
MOV.B
EDE,R5
; EDE -> R5. 00XXh
SXT
R5
; Sign extend low byte to R5.19:8
ADDA
R5,R7
; Add signed 20-bit values
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...