Programming HP48GX
Programming HP48GX
in SystemRPL
Overview
;
This small program ensures that there are two objects on the stack
and if so dispatches there types in this case 2Reals. If we have
two reals then the systemRPL function DOBEEP is called.
So why should you use SystemRPL rather than UserRPL?
For many years I have noticed that surveyors have been dissatisfied
with the HP48GX/49G because of speed problems. Many programs
available today do not go a long way to dispelling this perception.
So why does the calculator suffer from these perceived speed
problems? The answer lies in the language in which the programs
have been written.
If you use UserRPL than you may suffer from two problems:
1.
Entry Points are addresses in the calculators ROM that allow the user
to access the 3000+ SystemRPL commands that do not contain names
in the calculators UserRPL table.
SystemRPL commands have recognised names, they are simply not
stored on the calculator and therefore cannot be compiled internally
like UserRPL programs.
When you write a SystemRPL program, the compiler searches for the
name in an entry point table (this is a table that contains a series of
command names and their corresponding addresses in the Calculators
ROM)
Below is an example of part of an entry point table
=4PICK
=4PICK#+
#35E20
#35E20
#3610B
#35F2E
EQU
EQU
#3448A
#3679D
=4PICK#+SWAP
=4PICK+SWAP
=4PICKOVER
EQU
=4PICKSWAP
EQU
EQU
EQU
RPL
::
CK2&Dispatch
2REAL
::
%HMS>
%POL>%REC
;
NIBASC /HPHP49-C/
RPL
We could also remove the command 2REAL and the secondary under
that as we no longer need to check for two reals. The program would
simply be:
ASSEMBLE
NIBASC /HPHP49-C/
RPL
::
%HMS>
%POL>%REC
;
SURVEY.A
-H B.M
You may have noticed the file B.M in the last command. You will need
to create this file containing the following:
TITLE
REL
OUTPUT
LLIST
SEARCH
SUPRESS
END