COEN 20 Programming Lab #4a solved

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

Create a single ARM Cortex-M4 assembly source code file
containing four functions. (Note that functions 𝑅𝑜𝑜𝑡1 and
𝑅𝑜𝑜𝑡2 should both contain calls to functions 𝐷𝑖𝑠𝑐𝑟𝑖𝑚𝑖𝑛𝑎𝑛𝑡
and 𝑆𝑞𝑢𝑎𝑟𝑒𝑅𝑜𝑜𝑡.) Functions 𝐷𝑖𝑠𝑐𝑟𝑖𝑚𝑖𝑛𝑎𝑛𝑡, 𝑅𝑜𝑜𝑡1, 𝑅𝑜𝑜𝑡2
and 𝑄𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐 are called by a main program (download
from here) that will test your functions for three test cases. All
of the parameters and return values are of type int32_t:
1. 𝐷𝑖𝑠𝑐𝑟𝑖𝑚𝑖𝑛𝑎𝑛𝑡(𝑎, 𝑏, 𝑐) = 𝑏
2 − 4𝑎𝑐
2. 𝑅𝑜𝑜𝑡1(𝑎, 𝑏, 𝑐) =
−𝑏+𝑆𝑞𝑢𝑎𝑟𝑒𝑅𝑜𝑜𝑡(𝐷𝑖𝑠𝑐𝑟𝑖𝑚𝑖𝑛𝑎𝑛𝑡(𝑎,𝑏,𝑐))
2𝑎
3. 𝑅𝑜𝑜𝑡2(𝑎, 𝑏, 𝑐) =
−𝑏−𝑆𝑞𝑢𝑎𝑟𝑒𝑅𝑜𝑜𝑡(𝐷𝑖𝑠𝑐𝑟𝑖𝑚𝑖𝑛𝑎𝑛𝑡(𝑎,𝑏,𝑐))
2𝑎
4. 𝑄𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐(𝑥, 𝑎, 𝑏, 𝑐) = 𝑎𝑥
2 + 𝑏𝑥 + 𝑐
Note: Function SquareRoot is a function written in C
implemented in the same source code file as the main program.
It requires a single unsigned integer parameter and returns an
unsigned integer result. It should be called from your assembly
language functions Root1 and Root2.
If your code is correct, the three
test cases should look similar to the
image above. Incorrect values will
be displayed as white text on a red
background.