From your personal experience so far writing in C or C vs as

From your personal experience so far writing in C (or C++) vs. assembly code, which one made more prone for syntax errors or bugs?

Solution

From my personal experience the programming in C/C++ made more prone to syntax errors or bugs than the assembly language programming.

If we see practically every programming languages had its own advantages and disadvantages, hence with respect to practical systems we need to decide the programming language required for us.

C Language:

1. It\'s very easy to write the program for a given problem as it\'s functions mainly depends on the variables declaration.

2. Further it offers an 4 types of data types ( int, char, float & double) with the extension of signed & unsigned and also short & long for int, float & double.

3. As we will be performing the operations with respect to variables we need not to worry about the registers present in the controller as compiler will handle that problem.

4. We can also write functions for specific work that has to done by controller repeatedly which saves our time.

5. The errors in the syntax can be easily identified by knowing the type of error occurred.

6. But if the program was too long it\'s difficult to identify the errors.

7. Also these errors are due to improper declaration of variables and functions, may be due to improper calling of functions into the main function and it can be due to mismatch of square brackets, parenthesis and also the improper termination of the program.

8. Errors will appear if the correct header files were included for the functions that will be used in the program.

9. When generating an Hex file if small mistake occurs then this will cause problem inside controller to control the system.

10. The Hex file generated using compiler will be always larger in size than assembly code Hex file.

11. By using this we can simple to complex problems easily if controller had sufficient memory to accommodate the Hex file created and user friendly. But we should take there will no errors with respect to syntax.

Assembly Language:

1. When compared to C Language everyone feels assembly is difficult to write complex programs as if there is any small mistake in selecting registers will cause run time errors rather than syntax errors.

2. In order program in this language you must and should familiar with the mnemonics available for the controller as it is that much of easy to assign values to the registers and than performing functions.

3. Here operations performed with respect to registers and all the operations should occur in accumulator program becomes too complex when moving data between accumulator and registers to perform operations.

4. It will also offers an use of functions for repeaitative work it must be written clearly otherwise run time errors will be huge.

5. In this language we get syntax errors only if use incorrect mnemonics and perform operations with respect to registers other than accumulator.

6. Also we prefer this language as size of the file is small compared to C Language file and we can use if memory is less or more for the controller.

7. But when the program is to lengthy then we won\'t prefer even though it is advantageous reason run time errors causing statements cannot be identified that much of easily as that of C Language.

Hence, we need to decide which language to be used depending upon practically available system. But we always prefer C Language as this will not cause to much of run time errors and if syntax errors are present they can be easily corrected than in assembly.

From your personal experience so far writing in C (or C++) vs. assembly code, which one made more prone for syntax errors or bugs?SolutionFrom my personal exper
From your personal experience so far writing in C (or C++) vs. assembly code, which one made more prone for syntax errors or bugs?SolutionFrom my personal exper

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site