Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Text Editor (NASM x86_64)

This project is a small assembly-language program that:

  1. Opens a text file passed as the first CLI argument.
  2. Reads up to a configurable buffer size from the file.
  3. Prints the file content to stdout.
  4. Reads additional input from stdin.
  5. Appends the input to the original buffer and writes the result back to the same file.

Source file: Text Editor

Prerequisites

  • Linux (tested with GNU/Linux tooling)
  • nasm
  • ld (from binutils)

Install dependencies on Debian/Ubuntu:

sudo apt update
sudo apt install -y nasm binutils

Build

nasm -f elf64 -o text_editor.o "Text Editor"
ld -o text_editor text_editor.o

Run

  1. Create a test file:
echo "Initial content;" > sample.txt
  1. Run the program with the file path as first argument:
./text_editor sample.txt
  1. Type text in stdin and press Ctrl+D to finish input.

The program prints what it reads and updates sample.txt with appended content.

Notes

  • The program currently uses Linux syscalls directly (sys_open, sys_read, sys_write, sys_close, sys_exit).
  • The read and working buffers are controlled by BUFFER_SIZE in the source file.
  • The file path comes from argv[1]; if omitted, behavior is undefined.

Quick start (clone to run)

git clone <repo-url>
cd Text_editor_assembly
nasm -f elf64 -o text_editor.o "Text Editor"
ld -o text_editor text_editor.o
echo "Initial content;" > sample.txt
./text_editor sample.txt

About

Tarea de Micros, editor de texto básico

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors