This document, "SYSTEM PROGRAMMING TECHNIQUES FNDBLK," dated January 5, 1972, describes a procedure to determine the physical disk block address of a relative block (R) within a disk file for a non-privileged program.
The process involves three main steps:
Reading the HOME Block: The procedure first accesses and reads the file's HOME block (e.g., HOME.SYS[1,4]). This block contains critical file structure information, including the logical unit number (HOMLUN), count and address pointers for retrieval information (HOMCNP, HOMCLP), and the number of blocks per cluster (HOMBPC).
Reading the First Retrieval Information Block (RIB): Next, the first RIB for the target file is read. The document notes that if a file is being written to, it must be in UPDATE mode for its RIB to be properly written to disk.
Scanning RIBs for the Relative Block:
XWD 0,400000+n), indicating the logical unit for the subsequent blocks it describes.L = HOMBPC*K).
R falls within this range, the physical address is found by R - BASE + J (where BASE tracks the start of the current range, and J is derived from HOMCNP and HOMBPC), and the physical unit is obtained from the last unit-change-pointer.R is not in the current range, BASE is updated, and the scan continues to the next pointer.XWD 0,-1) indicates that the block is not in the current RIB, the procedure reads the next RIB (e.g., USETI -n, INPUT), updates BASE from the new RIB's word 33, and continues the scanning process.0 signifies an error.The document concludes with an assembly language program snippet demonstrating how to implement this FNDBLK technique.
Site structure and layout ©2025 Majenko Technologies