Project Abstract
Project Abstract
PROJECT
NAME : SASHRUTHI R
REG-NO :2303717672622052
SUBJECT-CODE :20MSS46
DATE : 22.02.2025
ABSTRACT:
A text editor is an essential tool that enables users to create, modify, and manage plain
text files efficiently.
This project focuses on developing a simple yet functional text editor application, offering
core features like file creation, open, save, save as, edit (append/overwrite), and backspace
operations.
Designed to mimic basic notepad functionality, the editor supports interaction through a
user-friendly interface and menu options.
This project is built using EMU8086 Assembly Language, showcasing low-level programming
capabilities by directly interacting with system resources.
The editor reads input from the user, performs real-time editing, and saves data to disk, all in
assembly. It reflects an understanding of memory addressing, file handling, and string
operations at the machine level.
The primary aim of the project is to demonstrate how a basic notepad can be implemented
in assembly, which is often considered challenging due to the absence of high-level abstractions.
Additionally, the editor emphasizes the importance of usability in system-level applications,
serving as an ideal educational project for understanding how text editors operate internally.
This application has practical usage in embedded systems or bootloaders, where minimal text
editing is required without relying on large software environments.
PROBLEM STATEMENT:
OBJECTIVE:
Develop a basic file editor in EMU8086 assembly to simulate Notepad-like functionality.
• Allow users to create, open, write, append, and read text files.
• Provide an interactive menu-driven interface using DOS interrupt services.
• Enable "Save" and "Save As" features through reuse of write/create logic.
• Support a "New Window" functionality by clearing the screen.
• Provide real-time input reading and handling of user-typed characters.
• Implement a backspace effect through overwrite/append control (can be extended).
• Perform file error checking using DOS function return flags.
• Display success/failure messages after each operation.
• Work as an educational example of file handling, memory usage, and string operations in 8086
Assembly.
SCOPE
Target Users: Assembly language learners, students, and low-level programming enthusiasts.
• Provides basic text operations in .asm format, usable for code writing or plain text editing.
• Supports 9 core operations through a single keypress menu:
TOOLS USED:
SOFTWARE:
Emu8086
Int 21h DOS interrupts
Int 10h
Memory buffers
HARDWARE:
Ram
Hard disk
I5 processor
BLOCK DIAGRAM:
_____________
| start |
_____________
|
_____________
| Display menu |
_______________
|
_______________
| Get user input |
_______________
|
/ \
/ if \ yes
/ menu \ __________
\ !=5 / |
\ / |
\ / |
|
| no |
_______________ |
| Perform the task| |
________________ |
| |
_______ |
| End | ____________
_______
SOURCE CODE :
ORG 100h ; Start of the program (.COM file starts at 100h)
START:
INT 21h
INT 21h
CMP AL, 1
JE NEW_WINDOW
CMP AL, 2
JE OPEN_FILE
CMP AL, 3
JE SAVE_FILE
CMP AL, 4
JE SAVE_AS
CMP AL, 5
JE EXIT
CMP AL, 6
JE CREATE_FILE
CMP AL, 7
JE APPEND_FILE
CMP AL, 8
JE WRITE_FILE
CMP AL, 9
JE READ_FILE
NEW_WINDOW:
JMP START
OPEN_FILE:
INT 21h
MOV SI, 0
READ_OPEN_FILENAME:
INT 21h
JE DONE_OPEN_FILENAME
INC SI
JMP READ_OPEN_FILENAME
DONE_OPEN_FILENAME:
MOV filename[SI], 0 ; Null-terminate filename
INT 21h
INT 21h
JMP START
CREATE_FILE:
INT 21h
MOV SI, 0
READ_FILENAME:
INT 21h
CMP AL, 13
JE DONE_FILENAME
MOV filename[SI], AL
INC SI
JMP READ_FILENAME
DONE_FILENAME:
MOV CX, 0
INT 21h
INT 21h
JMP START
APPEND_FILE:
INT 21h
MOV SI, 0
READ_APPEND_FILENAME:
INT 21h
CMP AL, 13
JE DONE_APPEND_FILENAME
MOV filename[SI], AL
INC SI
JMP READ_APPEND_FILENAME
DONE_APPEND_FILENAME:
MOV filename[SI], 0
INT 21h
JC FILE_ERROR
MOV fileHandle, AX
INT 21h
MOV SI, 0
READ_APPEND_TEXT:
INT 21h
CMP AL, 13
JE DONE_APPEND_TEXT
MOV buffer[SI], AL
INC SI
JMP READ_APPEND_TEXT
DONE_APPEND_TEXT:
INT 21h
INT 21h
INT 21h
JMP START
WRITE_FILE:
INT 21h
MOV SI, 0
READ_WRITE_FILENAME:
INT 21h
CMP AL, 13
JE DONE_WRITE_FILENAME
MOV filename[SI], AL
INC SI
JMP READ_WRITE_FILENAME
DONE_WRITE_FILENAME:
MOV filename[SI], 0
MOV CX, 0
INT 21h
JC FILE_ERROR
MOV fileHandle, AX
INT 21h
MOV SI, 0
READ_WRITE_TEXT:
INT 21h
CMP AL, 13
JE DONE_WRITE_TEXT
MOV buffer[SI], AL
INC SI
JMP READ_WRITE_TEXT
DONE_WRITE_TEXT:
MOV CX, SI
INT 21h
INT 21h
JMP START
READ_FILE:
INT 21h
MOV SI, 0
READ_READ_FILENAME:
INT 21h
CMP AL, 13
JE DONE_READ_FILENAME
MOV filename[SI], AL
INC SI
JMP READ_READ_FILENAME
DONE_READ_FILENAME:
MOV filename[SI], 0
MOV AH, 3Dh
MOV AL, 0
INT 21h
JC FILE_ERROR
MOV fileHandle, AX
INT 21h
MOV SI, AX
INT 21h
INT 21h
JMP START
SAVE_FILE:
SAVE_AS:
JMP WRITE_FILE
EXIT:
INT 21h
FILE_ERROR:
INT 21h
JMP START
DB "3. Save",10,13
DB "5. Exit",10,13
DB "7. Append",10,13
DB "8. Write",10,13
DB "9. Read",10,13
filename DB 20 DUP(0)
fileHandle DW ?
END
TECHNICAL DISCRIPTION:
The emu8086 file editor project is a basic text editing application implemented in assembly language.
It simulates essential file operations like creating, opening, saving, appending, and reading files, along
with text editing capabilities such as typing, backspacing, and managing files. the editor runs on the
emu8086 emulator, which mimics a 16-bit x86 architecture.
The program uses dos interrupts (int 21h) for file handling and keyboard input/output.
It allows the user to interact with files through a menu system, edit text in a memory buffer, and
perform file operations, all within a memory-constrained environment typical of assembly language
programs. the project aims to simulate a simple notepad-like application with a focus on file
manipulation and basic text operations.
ERROR DETECTION & CORRECTION:
RECOVERD:
Changed the function into unique
RECOVERD:
Mov bx,dx
Mov al,[bx]
RECOVERD:
Al is 8 bit register,si is 16 bit register
Mov al,[si]
RECOVERD:
Changed the function name into unique
RECOVERD:
mov ah, 3Ch ; DOS function to create file
RECOVERD:
mov si, ax
INPUT&OUTPUT:
CONCLUSION:
the EMU8086 file editor project successfully implements a basic text editing application in assembly
language, replicating the core functions of a simple text editor. By utilizing DOS interrupts for file
operations and user input, the project demonstrates essential concepts of file handling, memory
management, and text manipulation in a 16-bit environment. It provides a hands-on experience in low-
level programming, focusing on understanding the inner workings of file operations and text editing
without the use of higher-level abstractions. While constrained by memory limitations, the project
effectively simulates a notepad-like editor, offering valuable insights into working with assembly
language and the x86 architecture.
BIBLIOGRAPHY:
Git hub: https://github.com/uzairahmednasir/8086-asm-text-editor/blob/main/TEXT_EDITOR.asm