Yazoo ---> Online Help Docs ---> Reference

Yazoo registers

All objects within Yazoo are ultimately derived from an overarching variable that we will call Zero, although that word has no meaning within Yazoo. Zero encompasses two composite variables. The first variable contains the ten so-called registers that are described in this section. The second variable within Zero is the workspace, where the lowest-level script (e.g. start.zoo) begins running. It turns out to be impossible for any script to find a register in the normal way (the reason being that no member or search path leads out of the workspace). This is a deliberate roadblock: it prevents these important variables from being deleted or modified, which would cause problems for built-in functions, such as log() and input(). Instead, Yazoo provides a bytecode operator that gives access to the registers directly. From the perspective of a script, registers have names just like ordinary variables: R_slong, R_composite, etc.

Registers are used by the built-in Yazoo functions to return information to the user. In general, registers can be treated in the same way as any other variable, except that they may not be redefined or deleted. The following code is perfectly legitimate:


    R_slong = that+1
    R_double = R_slong*3.14
    print(R_double)
   

However, using a register as a working variable is not recommended, since the register will be overwritten the next time some built-in function uses it for its return variable. It is generally a much better idea to copy any data one needs from the register immediately into a user-defined variable and work with it there.

The ten registers are listed in Table 3, along with their types and ID numbers. The ID numbers appear only in compiled bytecode. The types are ordinary variable types, because Yazoo's `registers' are ordinary variables --- they are not the real registers on the chip that assembly-language programmers deal with!


ID name type ID name type
0 R_slong slong 4 R_error_code ulong
1 R_double double 5 R_error_index ulong
2 R_string string 6 R_error_script composite
3 R_composite composite 7 R_warning_code ulong
      8 R_warning_index ulong
      9 R_warning_script composite

Table 3: Registers, by ID number


Prev: Def-general operators and flags   Next: Numeric and string registers


Last update: July 28, 2013

Get Yazoo scripting language at SourceForge.net. Fast, secure and Free Open Source software downloads