File Management System
File Management System
From the name – File Management System we can understand its purpose. It is to
perform the task of managing files of our computer. A general file manager does
have a lot of job to do. Most common jobs are:
:: Create file
:: Create folder
:: Change directory
:: Delete files
:: Delete folders
:: Show directory
:: Give the user a friendly command mode interface to operate with files and
directories
A very much popular and used such type or program is Windows Explorer which is
provided with Windows Operating System.
In this project we tried to build such type of file management system using
Assembly Language, which runs on Windows or DOS platform. We have followed the
idea of Windows Explorer to operate with files and directories. As done in Assembly
Language, there exist some drawbacks. The features and working procedure in
described in details below. We will call our program FMS in short through rest of
description.
Abstract View
FMS starts running with a graphical interface in ODS. It shows the contents of the
current directory at its view, and we can start operating with our files and
directories using FMS from here.
Features of FMS
The FMS does not have all the features we generally get from Windows Explorer.
Available features of FMS are:
:: Create file
:: Create folder
:: Change directory
:: Delete files
:: Delete folders
:: Show directory
Using FMS
Using FMS is very easy. Some simple keyboard commands does all the operation for
the user.
Operation Key
Quit ESC
New folder N
New file F
Rename File R
Remove directory D
Remove file T
Change directory M
Show directory P
Getting inside FMS:
FMS uses DOS and BIOS interrupts to do its job. All though 21 types of interrupts are
used to perform different operations. All used interrupts are listed at appendix A.
We have used some macros which are listed in appendix B.
“INCLUDE FILE_OP.ASM
INCLUDE STRING_OP.ASM
.MODEL SMALL
.STACK 100H
.DATA
FILENAME DB 64 DUP(0)
FOLDERNAME DB 64 DUP(0)
OLDNAME DB 64 DUP(0)
NEWNAME DB 64 DUP(0)
HANDLE DW ?
PATH DB 64 DUP (0)
LINE1 DB 80 DUP (178)
LINE2 DB 80 DUP (177)
DES DB 'ENTER DESTINATION : '
SOUR DB 'ENTER SOURCE : '
ILLI DB ' !!! ILLIGAL KEY !!!!'
STRLEN DW ?
DRIVE DB ?
PTH1 DB
'+--------------------------------------------------------------------+'
PTH2 DB ' CURRENTH PATH : '
.CODE
MAIN PROC
PRINT_TITLE LINE1,TL1,TL2,TL3,TL4,LINE2,79
PRINT_MENU MN1,MN2,MN3,MN4,MN5,MN6,MN7,MN8,MN9,MN10,MN11,60
WIN :
MOV AH , 0
INT 16H
.IF AL == 1BH ; ESC FOR QUIT
JMP END_WIN
MAIN ENDP
END MAIN”
Here the options for the operations are added with condition.
When we press the ESC key it goes to JMP_WIN. Which quits from FMS.
When we press ‘N’ it creates new folder. For creating new folder it uses
macro “CREATE FOLDER MACRO FOLDER NAME”
‘F’ uses for creating new file. It uses “OPEN_FILE MACRO F_NAME,F_HANDLE ”
When we press ‘T’ it removes file from directory. It uses “REMOVE_FILE MACRO
FILENAME”.
‘P’ uses for printing current path. It uses macros “GET_DRIVE MACRO DRIVE”
and “GET_DIR MACRO PATH”.
Here we have used some other macros. They are listed below.
1.NEW_LINE MACRO
It uses for creating new line.
“NEW_LINE MACRO
SAVE_REG
MOV AH , 02H
MOV DL , 0DH
INT 21H
MOV DL , 0AH
INT 21H
RES_REG
ENDM”
“ SAVE_REG MACRO
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH BP
PUSH SI
PUSH DI
PUSHF
ENDM”
“RES_REG MACRO
POPF
POP DI
POP SI
POP BP
POP DX
POP CX
POP BX
POP AX
ENDM”
13. INIT_DS_DX MACRO
It uses for initializing data segment.
“INIT_DS_DX MACRO
MOV AX , @DATA
MOV DS , AX
ENDM”
“INIT_ES MACRO
MOV AX , @DATA
MOV ES , AX
ENDM”
Drawbacks:
We managed to perform various task of the project goal. But as the project
grows bigger, it becomes difficult to combine all those individual tasks. It has
several drawbacks. These are:
Future Planning:
In future we will try to design it in graphics mode. Also we will try to include
the missing features.
Conclusion:
FMS is a very interesting project. But it’s not so easy to implement in
Assembly Language. In our project we used many macros.
Reference:
1. Assembly Language Programming & Organization of the IBM PC.
- Ytha Yu
- Charles Marut
- Douglas V. Hall
-
Appendix A:
Used Interrupts:
Appendix B:
Macros
File: STRING_OP.ASM
1. NEW LINE
File: MACROLIB.ASM
1. SAVE_REG
2. RES_REG
3. INIT_DS_DX
File: FILE_OP.ASM