📄 msp430x24x_mpy_08.s43
字号:
;******************************************************************************
; MSP430x24x Demo - 8x8 Signed Multiply Accumulate
;
; Description: Hardware multiplier is used to multiply two numbers.
; The calculation is automatically initiated after the second operand is
; loaded. A second multiply accumulate operation is performed after that.
; Results are stored in RESLO and RESHI. SUMEXT contains the extended sign of
; result.
;
; ACLK = 32.768kHz, MCLK = SMCLK = default DCO
;
; MSP430x249
; -----------------
; /|\| |
; | | |
; --|RST |
; | |
; | |
;
; B. Nisarga
; Texas Instruments Inc.
; September 2007
; Built with IAR Embedded Workbench Version: 3.42A
;******************************************************************************
#include <msp430x24x.h>
;-------------------------------------------------------------------------------
RSEG CSTACK ; Define stack segment
;-------------------------------------------------------------------------------
RSEG CODE ; Assemble to Flash memory
;-----------------------------------------------------------------------------
RESET mov.w #SFE(CSTACK),SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
mov.w #1234h,&MPY ; Load first operand - unsigned mult
mov.w #5678h,&OP2 ; Load second operand
mov.w #12h,&MACS ; Load first operand - signed MAC
sxt &MACS ; Extend sign
mov.w #96h,R15 ; Move to register
sxt R15 ; Extend sign
mov.w R15,&OP2 ; Load second operand
bis.w #LPM4,SR ; LPM4
nop ; Set breakpoint here
;------------------------------------------------------------------------------
COMMON INTVEC ; Interrupt Vectors
;------------------------------------------------------------------------------
ORG RESET_VECTOR ; MSP430 RESET Vector
DW RESET ;
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -