msp430x54x_mpy_3.c
来自「MSP430的开发程序的例子+中文注释」· C语言 代码 · 共 34 行
C
34 行
//******************************************************************************
// msp430FG5438 Demo - 16x16 Signed Multiply
//
// Description: Hardware multiplier is used to multiply two numbers.
// The calculation is automatically initiated after the second operand is
// loaded. Results are stored in RESLO, RESHI and SUMEXT = FFFF if result is
// negative, SUMEXT = 0 otherwise.
//
// ACLK = 32.768kHz, MCLK = SMCLK = default DCO
//
// msp430FG5438
// -----------------
// /|\| |
// | | |
// --|RST |
// | |
// | |
//
// M Smertneck
// Texas Instruments Inc.
// April 2008
// Built with CCEv3.2 IAR Embedded Workbench Version: 3.42A
//******************************************************************************
#include <msp430x54x.h>
void main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop WDT
MPYS = 0x01234; // Load first operand -signed mult
OP2 = 0x05678; // Load second operand
_BIS_SR(LPM4_bits + GIE); // LPM4
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?