mirror of
https://github.com/irmen/prog8.git
synced 2024-12-23 09:32:43 +00:00
tip for using aliases for the virtual registers r0-r15
This commit is contained in:
parent
7cfb33a448
commit
a231872821
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user