Skip to content

Software Development 2 Coursework covering how to write simple programs at the assembly/machine level for string processing and manipulation.

Notifications You must be signed in to change notification settings

tylersupersad/inline-assembly-string-manipulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Software Development 2: C with Inline Assembly

The objective of this program is to receive an input file (preferably text file) and convert/count the contents within that file using a specified argument in the command line. The result of the conversion/counting is translated into an output file called output.txt.

This command line tool is incredibly useful for counting the total amount of words present within the file and converting all text within a text file to uppercase and lowercase.

Command Line Argument Explaination

The command line tool will take arguments that will be passed by the parameters of the program. For example, to convert the content within a given input file to uppercase, then write and display it within an output file, the arguments will look like:

convert –u -i input.txt -o output.txt

image

In the example shown above, the -u indicates that the input file content should be converted to uppercase into the output file. Other arguments include the -l, and -c.

  • -l indicates that the input file should be converted to lowercase
  • -c indicates counting the words within the input file.

The input file should always be preceded by an -i to ensure to the program that you’ve entered a filename. The output file declaration follows the same principle, however it is preceded by an -o.

image

image

Default Functionality

The program will continue to run if the -i or -o arguments are not included for the filenames. If there is no -i included, the program will prompt the user to enter a text file (from stdin) for conversion. If -o is not included, then the program will continue to print the results in the stdout.

If specifiers like, -u, -l, or -c are not included in the command line then the program will default the contents of the input file to uppercase.

Recommendations

  1. Microsoft Syntax: It’s recommended to use the Microsoft compiler as the code comprises of inline assembly that runs on the Microsoft syntax.
  2. Makefile: A Makefile is a text file that describes how your program should be built (automates the builds). We’re using a Makefile to reduce the time on typing the compile command, and simple mistakes. Makefiles consists of dependencies and rules to produce a successful compilation.

image

Languages & Tools Utilized

About

Software Development 2 Coursework covering how to write simple programs at the assembly/machine level for string processing and manipulation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published