I have an assignment that's due on Friday, which ask me to write a programme in linux to format the original source code. I think of it for so long, anyone can help me with it?
Assignment: Write a bash program to format the comments in an assembly language source file.
Comments begin with a ; (semicolon) and end with a newline. The source file will contain only printing characters, spaces, and newlines. It is not necessary to check for invalid input. Requirements:
Lines without comments should not be changed. Entire lines which are comments (begin with
should not be changed. Lines containing both code and comments (; preceded by other characters) should have spaces inserted before the comments so all comments begin in the same column, at least 4 columns after the end of the longest code. Be sure your program includes all of the following:
comments with your name, the date, and the assignment comments or output with instructions for using the program prompts for any interactive inputs descriptive names and/or comments explaining variables & functions indentation of code blocks comments explaining any non-obvious control flow
The following is the code before and after. We should write a programme which reads a file contains the original code, and turn the original one to the formatted one, then output it on the screen. Please someone help me with it! Thank you!
Source Code: http://188.8.131.52/171/171-asm-14f.xhtml