5.6.1 Introduction
There are two types of FCB, the normal, whose length is 37 bytes and the extended one of 44 bytes. On this tutorial we will only deal with the first type, so from now on when I refer to an FCB, I am really talking about a 37 bytes FCB.
The FCB is composed of information given by the programmer and by information which it takes directly from the operative system.
When thesetypes of files are used it is only possible to work on the current directory since the FCBs do not provide sport for the use of the organization by directories of DOS.
The FCB is formed by the following fields:
POSITION LENGTH MEANING
00H 1 Byte Drive
01H 8 Bytes File name
09H 3 Bytes Extension
0CH 2 Bytes Block number
0EH 2 Bytes Register size
10H 4 Bytes File size
14H 2 Bytes Creation date
16H 2 Bytes Creation hour
18H 8 Bytes Reserved
20H 1 Bytes Current register
21H 4 Bytes Random register
To select the work drive the next format is followed: drive A = 1; drive B = 2; etc. If 0 is used the drive being used at that moment will be taken as option.
The name of the file must be justified to the left and in case it is necessary the remaining bytes will have to be filled with spaces, and the extension of the file is placed the same way.
The current block and the current register tell the computer which register will be accessed on reading or writing operations. A block is a group of 128 registers. The first block of the file is the block 0. The first register is the register 0, therefore the last register of the first block would be the 127, since the numbering started with 0 and the block can contain 128 registers in total.
5.6.2 Opening files
To open an FCB file the 21H interruption, 0FH function is used. The unit, the name and extension of the file must be initialized before opening it.
The DX register must point to the block. If the value of FFH is returned on the AH register when calling on the interruption then the file was not found, if everything came out well a value of 0 will be returned.
If the file is opened then DOS initializes the current block to 0, the size of the register to 128 bytes and the size of the same and its date are filled with the information found in the directory.
5.6.3 Creating a new file
For the creation of files the 21H interruption 16H function is used. DX must point to a control structure whose requirements are that at least the logic unit, the name and the extension of the file be defined. In case there is a problem the FFH value will be returned on AL, otherwise this register will contain a value of 0.
Quantum Computing: Revolutionizing the Future with Cutting-Edge
Advancements Introduction to Quantum Computing
-
Quantum Computing: Revolutionizing the Future with Cutting-Edge
Advancements
Introduction to Quantum Computing
Quantum computing is tran...
No comments:
Post a Comment