LSXDODGERS LDFCB

From Z80 Machines Wiki
Jump to: navigation, search

LDFCB


· LSX-Dodgers · File Control Block · (FCB file · control block) 37 bytes

<Offset> <Size> <Contents>

+0 *1 1 byte drive number

(0: current drive, 1: drive A 2: drive B, ...,, 8: drive H)

+1 *1 8 bytes Main file name (The rest contains space $20)

+9 *1 Three byte extension (The remaining space stores $20)

+12 1 byte current block It is stored from the lower byte 2 bytes for MSX-DOS

+13 *2*3 1 byte attribute (attribute), valid if bit is 1 bit 7 to bit 6: 0 bit 5: normal file bit 4: directory bit 3: Volume name bit 2: System attribute bit 1: Invisible attribute bit 0: write protect attribute

+14 *1*2 2 bytes Record size / Cluster number of directory to be accessed + 1 (0 for the current directory) Opening a file, searching, creating, and deleting It acts as the cluster number of the directory For random block access, record · Work as size. Record size is set to 1.

+16 *2 Size of 4 byte file (in bytes) It is stored from the lower byte

+20 * 2 2 byte Date when the file was last modified

+21 +20 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 □□□□□□□□ □□□□□□□□□ \ Year -1980 / Month / \ Day / 0 to 99 1 to 12 1 to 31

+22 *2 Time when 2 byte file was last changed

+23 +22 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 □□□□□□□□ □□□□□□□□□ \ Hour / \ min / \ sec / 2 / 0 to 23 0 to 59 0 to 29

+24 *2*3 1 byte open mode $FF: Read mode $FE: write mode $FD: Device Disk Printer Other: Not open When you open the file it becomes $FF Writing to the file will result in $FE


+25 *2 1 byte directory location

+26 *2 First cluster of 2-byte file It is stored from the lower byte

+28 *2*3 1 byte not used

+29 *2*3 1 byte Directory mode $00: Root directory Other: Subdirectory

+30 *2*3 2 byte directory · position Directory entry of the file being accessed Cluster number with. For the root directory Logical sector number It is stored from the lower byte

+32 1 byte current record

+33 4 bytes random record It is stored from the lower byte For CP/M80 3 bytes

  • 1 Parts to be set when opening
  • 2 Part different from CP/M80
  • 3 Differences from MSX-DOS


※ FCB Remarks FCB (File Control Block) is a file The file information such as name is stored in the memory. When opening a file, if the drive number is 0 (current drive), the actual drive (1 to 8). In the system call, "*" of the wild card is not expanded, so an appropriate number of "?" Before you deploy it. The access of the file of CP/M method is processed with record of 128 byte unit. One A record has 128 bytes. Also, starting with record 0, for example record 1 Indicates 128 bytes from the 128th byte from the beginning of the file.


In case of CP/M type sequential access, current block and current · A record calculated from the record is accessed. When accessed the next record The current block and the current record are set to point to. How to calculate the record number obtained from the current block and the current record Accessed record number = current block × 128 + current record When opening a file, the current record is not cleared with 0, so sequencer When accessing from the beginning of the file with access, change the current record to 0 and click I need to do it. In the case of CP/M type random access, the record set in the random record Access the card. Random records do not change.


In the case of CP/M type random access, the record set in the random record Access the card. Random records do not change. Is one byte. For file access with random block access, from the file pointer set in the random record Read and write HL bytes. The random record is incremented by the amount of access.

For CP/M 80

· FCB 36 bytes

+13 *3 1 byte private +14 *3 1 byte 0 +15 *3 1 byte record number +16 *3 16 bytes Block in which the file body is stored Block address

For MSX-DOS +14 *2 2 bytes Record size +24 *2 1 byte device ID +28 *2 2 bytes Cluster number last accessed + 30 *2 Relative position from 2 byte file start cluster eof