tip for using aliases for the virtual registers r0-r15

This commit is contained in:
Irmen de Jong 2024-11-02 22:09:20 +01:00
parent 7cfb33a448
commit a231872821
2 changed files with 4 additions and 1 deletions

View File

@ -150,7 +150,8 @@ you from having to type the fully scoped name everytime you need to access that
Aliases can be created in any scope except at the module level.
You can create and use an alias with the ``alias`` statement like so::
alias prn = txt.print_ub
alias score = cx16.r7L ; 'name' the virtual register
alias prn = txt.print_ub ; shorter name for a subroutine elsewhere
...
prn(score)

View File

@ -832,6 +832,8 @@ It is not possible to use floating point arguments or return values in an asmsub
``cx16.r0`` .. ``cx16.r15`` (these are memory mapped uword values),
``cx16.r0s`` .. ``cx16.r15s`` (these are memory mapped word values),
and ``L`` / ``H`` variants are also available to directly access the low and high bytes of these.
You can use them directly but their name isn't very descriptive, so it may be useful to define
an alias for them when using them regularly.
Expressions