BLOAD checks word 0 of the block for >994A. If >994A is not found then the data in the block is determined to be of invalid format and the operation fails, passing block to the stack. In other words, if after executing BLOAD the value on the stack is equal to block, the operation failed.
BLOAD uses the header in each block and installs the payload contents (1008 bytes) at the address defined by the offset + 6 (see BSAVE for offsets). BLOAD continues loading blocks until it encounters a block that does not have >994A in offset + 0. Upon completion, BLOAD pushes the next free block number (nfb) to the stack (i.e. the last BLOAD ed block+1).
It is not neccessary to understand the inner workings/format of the BLOAD /BSAVE block format. BSAVE takes care of formatting the data correctly in a form that BLOAD expects.
Note: A program saved as an image with BSAVE can only be executed on a TurboForth system of the same version. In other words, it is not possible to BSAVE a program in V1.1 and execute it in version 1.2. The program should be re-compiled from the source code, and BSAVE d on the version in which it is to be executed.
|