SPRUI04G June 2015 – August 2025
Assign a Variable to a Register in a Set
.pref symbol / register1 [/register2...]
The .pref directive communicates a preference to assign a variable to one of a list of registers. The preference is used only in the .cproc or .proc region the .pref directive is declared in and is valid only until the end of the region.
| symbol | A valid symbol name to be assigned to the register. The substitution symbol is up to 128 characters long and must begin with a letter. Remaining characters of the symbol can be a combination of alphanumeric characters, the underscore (_), and the dollar sign ($). | |
| register | List of actual registers to be assigned a variable. |
There is no guarantee that the symbol will be assigned to any register in the specified group. The compiler may ignore the preference.
When a symbol is declared with the .pref directive, it is not necessary to declare that variable with the .reg directive.
Here x is given a preference to be assigned to either A6 or B7. However, It would be correct for the compiler to assign x to B3 (for example) instead.
.PREF x/A6/B7 ; Preference to assign x to either A6 or B7