Binary Relocatable Format

BRF code is a stream of eight-bit bytes and can be stored on any data medium (tape, file etc). The information can be divided into the following three basic types:


 * Control information: A single byte, the control number. This is interpreted as a linker command.


 * Programmed information: Two bytes containing a 16-bit word, called a P-group


 * Symbolic information in either four bytes for MAC or NPL, or six bytes for BRF produced by compilers (e.g. FORTRAN). This is called an S-group and contains a symbol of one to seven packed six-bit characters.

BRF code are sequences of BRF groups, where each BRF group is a a combination of the three basic types. A BRF group can take one of the following four forms:   

BRF Control Numbers
The possible values and meaning of the control numbers are described in the following table. 'Words' are 16-bits words in big endian format.

BRF decoding example
The BRF Linker can also be used to inspect BRF code. The example below shows how to look at a single library function, "5STOP" (an internal Fortran function) from the Fortran-100 2-bank library file FORTRAN-2BANK:BRF. The BRF Linker command LIST-BRF-CODE is used to show the library entry. The columns are interpreted as follows:
 * 1) Current location counter (octal)
 * 2) BRF control number (octal)
 * 3) BRF control number mnemonic
 * 4) Either:
 * 5) * Symbolic names (LIBR, ENTR, MAIN etc.), or
 * 6) * Binary information (octal)
 * 7) Disassembled instruction (if program mode, e.g. set by PMO)
 * 8) Other values (octal), if relevant

- BRF Linker - 210721C01 Brl: list-brf-code Input file :fortran-2bank First unit :5stop Last unit :5stop Output file: 1    17 BEG  *** new BRF - unit *** 1    32 LONG 1    51 DMO 1    15 LIBR 5STOP 1    50 PMO 1    16 ENTR 5STOP 1    24 LNF       3 1            146147 COPY SL DX     2             135024 JPL I * 24 3                 0 STZ * 4    20 REF  5STACK 5    24 LNF      21 5               600 STZ ,B - 200 6                 1 STZ * 1 7                 0 STZ * 10            146157 COPY SA DX    11              46000 LDA ,X 0 12              4606 STA ,B - 172 13             46001 LDA ,X 1 14              4607 STA ,B - 171 15             44606 LDA ,B - 172 16              4406 STA ,B 6 17             44607 LDA ,B - 171 20              4407 STA ,B 7 21             44602 LDA ,B - 176 22            172406 AAA 6 23            171002 SAT 2 24            135003 JPL I * 3 25            135003 JPL I * 3 26    20 REF  5INIT 27    20 REF  5MSTOP 30    20 REF  5LEAV 31    51 DMO 1    50 PMO 31     6 AFR       2,3 31     6 AFR     210,20 31     6 AFR     210,16 31    51 DMO 1    50 PMO 31    21 END  checksum :  27512 Brl:

Note that the disassembled code may not be the final instruction as will be seen in the linked PROG file. In the example above the three AFR entries are used to modify the values of earlier fields (see AFR description in the table of control numbers). Here the location PB+3, which is 0+3, i.e. location counter 3 in the listing (0 STZ * is changed to 2, which is STZ * 2, and locations 208 and 168 are added with 2108, resulting in instructions STA ,B - 161 and STA ,B - 162 respectively.