Skip to content

dariafurtuna/Diff-Tool-Assembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Diff Utility (x86-64 Assembly)

This project is a simplified version of the Unix diff tool, implemented in x86-64 assembly (AT&T syntax).
It compares two text inputs line by line and highlights the differences, with optional flags for case-insensitivity and blank-line handling.


📂 Project Structure

  • diff.s
    Contains the full implementation:

    • main: Parses command-line arguments and sets flags (-i, -B).
    • diff: Core comparison logic.
    • compareLines: Compares two lines, optionally ignoring case (-i).
    • printDifferentLines: Outputs differences in a readable format.
  • Example input (hardcoded in diff.s for now):

    file1 = "a\nkFds\nfdsan\nabc\n"
    file2 = "A\nkFds"
    
    

⚙️ Building

Use gcc to assemble and link the program. For example:

gcc -no-pie diff.s -o diff

This creates an executable called diff.


▶️ Usage

For now, diff.s contains two hardcoded input strings (file1 and file2).
When you run the program, it compares those and prints the differences.

Example:

./diff

Output format:

1c1
< a
----
> A

Command-line flags

The program supports two optional flags:

  • -i → Ignore case differences (e.g., "a" == "A")
  • -B → Ignore blank lines when comparing

Example:

./diff -i
./diff -B
./diff -i -B

About

Oct 2024

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published