Reference no: EM132244776
Create a program in an assembly that calculates the amount of arithmetic progression from 1 to n with step 1.
– The parameter and the numbers to be returned, are no sign, so positive.
– In case of errors or incorrect input data, must return 0.
– Error analysis is done by the assembly program, and C program prints everything returned by the assembly, including error codes.
The number n is given as a parameter. Develop and tender:
1. Makefile - file that allows you to compile your program
2. md1.h source code file with a feature prototype that will be included in C, and will implement the assembly code.
3. md1.s - program in an assembly that calculates the amount of arithmetic progression.
4. md1_main.c - program in the language C that calls the assembly program and gives to it parameter n and receives the result printed on the screen.
When testing, the parameter n should be passed from the command line.
So, you will have to create program main () in md1_main.c, which receives the parameter via argv [1], transforms it into int integer. This number should be given as a parameter for asum () implemented in the assembly code, in the file md1.s.
The result must returned to C program and printed, for example, with printf () function. You only need to print the number and the line end symbol 'n'.
It is essential to stick to the prototype of such a function so that it is unified with the interface as used by the testing programs.
Attachment:- MD1.rar