O'Reilly logo

ARM® Cortex® M4 Cookbook by Dr. Mark Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Performing arithmetic operations

Writing a program that adds two numbers together may seem like a trivial task. We obviously need to declare three variables, two to hold values of the numbers to be added, known as addends, and another to hold the sum. The following recipe illustrates some problems that arise due to word length.

How to do it…

The following steps demonstrate how to perform arithmetic operations:

  1. Create a new folder and name it addTwoNums_c3v0. Invoke uVision5 and create a new project named addTwoNums within this folder.
  2. Use the RTE manager to select the MCBSTM32F400 evaluation board and configure it as we did for helloWorld_c2v0, from the Writing to console Window recipe in Chapter 2, C Language Programming.
  3. Copy the files, Serial.c ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required