Documente Academic
Documente Profesional
Documente Cultură
As shown normal file handles are 00 for keyboard and 01 for screen display, File handles
for disk device have to be set by your program. You can also use these services for redirecting
input and output to other devices.
Other I/O services involve the use of a file handle for operations that access file; for these
you have to request the file handles number from the system. A disk file must first be opened;
unlike transferring data from the keyboard or to the screen, the system has to address disk files
through entries in its directory and FAT, and must update these entries. Each file that a program
reference during execution must be assigned its own unique file handle.
The system delivers a file handle when you open a file for input or create a file for
output. The operations involve the use of ASCIIZ string and INT 21 function 3CH or 3DH. The
file handle is a unique one-word number returned in AX that you save in a word data item and
use for all subsequent requests to access the file. Typically, the first file handle returned is 05, the
second is 06 and so forth.
The PSP contain a default file handle table that provides for 20 handles, but you can use
INT 21H function 67H to increase the limit.
The file handle operation for disk delivery a completion status via the Carry Flag and the
AX register. A successful operation clears the Carry Flag to 0 and performs other appropriate
functions. An unsuccessful operation sets the Carry flag to 1and returns an error code in AX
depending on the operation.
8.5 Materials/Equipment
Figure 1. Title
8.7 Procedure/s
2. Write the following program using SK’s notepad or any of your text editor using the
filename sam8.asm
.model small
.code
org 100h
end start
3. Execute the program. When the prompt appears, input the string “RED” then press enter.
1. Given the sample output coming from your instructor, write down and compile the
required program that will provide the expected sample output using expt8.com as
the filename.
expt8.asm
8.8.2 Calculations
8.8.3 Observations
Creating a file you just need mov ah, 3 int 21h and for creating directory you just
need mov ah, 39h int 21.
8.8.4 Conclusion/s
Creating directory you can choose many attributes such as hidden, normal, archive, etc.
Total Score