ic-it / nasm-right-align

NASM program that aligns text on the right side

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assembly Program Documentation

Asciinema: asciinema

Included Files

  • macro.asm: This file contains macros used within the assembly program.

External Functions

  • open_file, read_file, write_file, close_file, seek_file, write_stdout, write_one_byte, write_newline, read_stdin: These functions are imported from external sources to perform file operations, standard input/output operations, and seek operations.

  • init_args, get_argc, get_argv, get_arg: These functions are used to handle command-line arguments.

  • strlen, strcmp, itoa: These functions are used for string manipulation.

Constants

  • BUFFER_SIZE: Defines the size of the buffer used for reading files.

  • Open flags (O_RDONLY, O_WRONLY): Flags used for file opening mode.

  • Seek flags (SEEK_SET, SEEK_CUR, SEEK_END): Flags used for seeking within files.

Data Section

  • Contains various messages used by the program, such as help messages, error messages, and prompts.

BSS Section

  • Defines uninitialized memory for variables such as buffer, file descriptor, line number, and current file line count.

Text Section

show_help_message

  • Description: Displays the help message, including program usage and author information.

_start

  • Description: Entry point of the program. Processes command-line arguments and calls relevant functions based on the provided arguments.

process_file

  • Description: Processes a single file. Opens the file, reads its content, displays line numbers, and handles pagination.

get_max_line_length

  • Description: Determines the maximum line length in a file.

display_lines

  • Description: Displays lines from a file, handling pagination if necessary.

get_next_line_length

  • Description: Retrieves the length of the next line in a file and seeks back to the original position.

display_line

  • Description: Displays a single line from the buffer.

fill_buffer_with_white_spaces

  • Description: Fills the buffer with white spaces.

do_pagination

  • Description: Handles pagination by prompting the user to read more lines or exit.

segfault_exit

  • Description: Exits the program with an error message in case of a segmentation fault.

ok_exit

  • Description: Exits the program successfully.

no_files_exit

  • Description: Exits the program with a usage message if no files are provided.

error_exit

  • Description: Exits the program with an error message.

About

NASM program that aligns text on the right side

License:MIT License


Languages

Language:Assembly 81.8%Language:C 14.9%Language:Makefile 3.3%