HP 48gII Advanced User's Reference Manual page 497

Graphing calculator
Hide thumbs Also See for 48gII:
Table of Contents

Advertisement

A link label is identified by a '
Note 1: In projects, using less global labels is better because a global label takes longer to compile and because it
gives a better program structure. A good habit is to use global labels to cut the program in subroutines, and to use
local labels inside these subroutines.
Note 2: The command line editor is able to find labels in a source. See the
menu.
TOOL
Note 3: labels in System RPL should only be used by people who know what they are doing. They are only used for
fixed address program (absolute mode) which is pretty advanced programming.
Note 4: Labels can not be given the same name as constants.
4.1.8
"extable"
"extable" is an external library that contains a list of constants. This list can be used by MASD as a basic list of
constants and is especially useful to the System RPL programmer as most entry points are defined there (like
TURNMENUOFF for example). In addition, it also contains a set of supported constants and ASM entry points for
the ASM programmer. Please read the extable section in this document to find more information about this library.
4.1.9
Constants
Constants are a way for the user to associate a value to an alphanumerical name. This is extremely useful as it makes
programs much easier to read and makes them more portable. One of the most popular ways to use constants is to
represent memory address for storage of variables.
For example, instead of typing
the beginning of the project and then to type
and less likely to cause errors).
You can create a constant in ASM or ARM mode by doing:
DC CstName ExpressionHex
DEFINE CstName ExpressionHex
EQU CstName ExpressionHex
In RPL mode, the only valid way to define a constant is:
EQU CstName ExpressionHex
is either a hexadecimal number or an expression (starting with a char that can not be confused
ExpressionHex
with the start of a hex number (
leading
, an expression starting with a decimal number can be typed with a leading
$
starting with a constant that starts with a
Note 1: A constant cannot be given the same name as a label.
Note 2: The name of a constant follows the same rules as the name of a label.
Note 3: A constant value is stored in 16 nibbles.
Note 4: Having constants starting with something that can be interpreted as a hex number, or an ARM register is not
a good idea as the compiler might get confused. For example:
error on
as the compiler will interpret the mov as a mov from SP to R4.
FOO
MASD introduces a 'constant pointer' called CP which helps to define constants. CP is defined by:
CP=ExpressionHex
CP is defined on 5 nibbles, its default value is 80100 (an area of memory that can be used freely by programmers).
EQUCP Increment ConstantName
Declares a constant with the current CP value and then increase CP by Increment.
Note 1: in ASM and ARM mode,
Note 2: Increment is a hexadecimal value, to use a decimal value, put a leading
For example, if CP equals to $10
EQUCP 5 Foo
Defines a Foo constant with a value of $10 and then change the value of CP to $15.
Several constants can be defined at once using CP.
' as the first character.
_
every time it is needed, it is better to declare
D1=80100
D1=(5)Result
or
or
..
,
..
). An expression starting with a hexadecimal number can be typed with a
0
9
A
F
..
or
..
character, you should put the constant in brackets.
0
9
A
F
DCCP Increment ConstantName
selection in the command line
GOTO
when needed (it is more portable, more readable
character. For an expression
#
DC SPFOO 4 MOV R4 SPFOO
is also valid
.
#
The Development Library 6-11
at
DC Result 80100
will generate an

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

49g+

Table of Contents