<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


BLOAD Search:

In Block I/O Words in TurboForth Kernal

Word Name: BLOAD
Type: Standard word
Data Stack Signature: block -- nfb
Return Stack Signature: --
Availability: V1.0  V1.1  V1.2
Description:

Loads a block of raw memory from block storage that has been previously saved with BSAVE.

Example:

none

Comment:

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 BLOADed 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 BSAVEd on the version in which it is to be executed.

See Also: BSAVE 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>