{% extends "base.html" %} {% block additional_js %} {% endblock %} {% block content %}
The intention is to provide access to all HP42S RPN commands or to provide an equivalent.
?!,.<>+-×÷≤≠↑Σ→
etc. are not valid Python syntax, so alternative names have been invented. E.g.
FS?
is exposed as e.g. isFS()
.
CLΣ
where it is difficult to type in the unicode Sigma Σ symbol,
so the command has been renamed CLStat()
.
( )
after the function,
so even RPN commands that are supported by the Python to RPN translator, like ABS
,
need to be called with brackets e.g. ABS(n)
. And if those RPN commands traditionally take
parameters from the 'stack' then you will need to supply those parameters inside the brackets e.g. ABS(n)
.if var < 0:
instead of X<0?
The description column in the table below is the original "pure" HP42S command description, which will often refer to the stack. The stack is not exposed to the user in Python so please translate these descriptions as follows:
SIN
which acts on stack x is simply SIN(var)
when accessed via Python.
(y,x)
. Notice
that y goes first because during conversion to RPN,
Python parameters are pushed onto the the stack from left to right, so the first parameter
ends up in the y stack position and the second parameter ends up in the x stack position.
ATOX
which leaves a
character code (returned to the x-register)
should be used in Python like this e.g.: mychar = ATOX()
.
ATOX()
.
This is perfectly OK in Python. You just cannot get access to the result later, that's all.
An attempt has been made to redact material in the original "pure" HP42S command description column
which might be misleading. The text is struck out but remains, so that the original intent of the command
is visible, which may aid understanding and programming.
HP42S Command | Supported in Python to RPN | Comments | Parameters | Description (original HP42S) |
---|---|---|---|---|
{{ cmd }} | {{ cmd_list[cmd]['supported'] }} | {{ cmd_list[cmd]['suggestion'] | safe }} | {{ cmd_list[cmd]['params'] }} | {{ cmd_list[cmd]['description'] | safe }} |
Acknowledgement: List of commands taken from the Alternative HP-42S/Free42 Manual