This assignment involves creating a hex dump program, which is executed in two distinct programming languages: C and assembly, specifically targeting the x86_64 architecture. The primary function of a hex dump program is to read binary data from a file or input stream and display each byte in a readable hexadecimal format. This is particularly useful for debugging or analyzing binary files where textual representations are not available.
In the first part of the assignment, the program is implemented in C. This implementation requires setting up file reading operations, converting the binary data to hexadecimal format, and properly formatting the output for readability. The C standard library functions are utilized for handling file operations (like opening, reading, and closing files) and for formatting and printing the output. Special attention is needed to ensure error handling and efficient memory management.
The second part of the assignment involves re-implementing the same functionality, but this time using assembly language, which offers a more granular level of control over the system. This implementation adheres strictly to the x86_64 calling conventions, which dictate how functions receive arguments and return results. System calls are used for file operations, and manual implementation of data conversion and output formatting is required. Assembly language programming demands a deeper understanding of the underlying hardware and system-level operations.