Syntax:
assert(<expression>)
Produces an error if the expression evaluates to zero.
Syntax:
base()
Returns the current base adress.
Syntax:
origin()
Returns the current origin.
Syntax:
pc()
Returns the current program counter (origin + base).
Syntax:
array.size(<name>)
Returns the number of elements in an array, or produces an error if the array is not defined.
Syntax:
array.sort(<name>)
Sorts the specified array in ascending order.
Syntax:
file.exists(<filename>)
Returns 1 if <filename>
exists, or 0 if not.
Syntax:
file.size(<filename>)
Returns the size of <filename>
on disk, or produces an error if the file is not found.
Syntax:
read(<address>)
Reads a byte from the currently open output file, or produces an error if there is no file currently open. The address provided is the origin, or literal file address. The base offset is not factored in when this function is used.
Note:
The resulting values read from a target file are only valid during the write phase of assembly! If you rely on the value read back during a previous pass to control outputting code, bass may assemble the source code incorrectly. Use this function with caution. It is mostly intended for when bass is used in patching mode.