24.08.2001
Library 502 : EXT49 v2.2
by Yoann DESIR
e-mail: YoannDESIR@yahoo.com
pages web : | http://ydesir.multimania.com/hp48gx/english.html |
http://hp49g.multimania.com/english.html |
This library allows system-RPL programming using mnemonics.
First of all, the required datas for EXT49 are available in the file "Vars1.07", which you have to execute after its transfer on the calculator. Since then, datas are written in two new variables of the hidden directory of HOME.
Notice that the "Crvar" entry allows you to create a file, which may replace "Vars1.07", with the mnemonics and adresses information that you are using at the moment and which are stored in the hidden directory of HOME.
EXT49 by Y.Désir
Version 2.2
System-RPL programming
for HP49G
->Prg: Takes a string containing words called " mnemonics " and creates a program or a list with
it.
Both programs and sub-programs are delimited using "begin" at the beginning and "end" at the
end; lists are delimited by "{" and "}".
Be careful, every program or list started must be ended by the proper delimitor, else an error
occurs.
The program or the list generated is left on the stack.
Without any "begin" or "{" at the beginning of the string, all mnemonics are EVALUATED after
conversion into system RPL commands. In the main string, any command located after the first
RPL structure or after the first list is ignored.
Note : system RPL compilation has been greatly fasten in this version.
Prg->: Reverses the operation processed by -Prg. Lists and RPLs are accepted, but Prg-> also functions with a global name, which contents is converted into a string, or else with an XLIB name, which contents is processed the same way.
->mn: Converts the objet on stack level 1 into its associated mnemonic.
mn->: Reciprocal operation. Interest: get back the system command associated to the provided mnemonic without executing it.
TABLE OF CONVERSION BETWEEN OBJECTS AND MNEMONICS
Real number |
0 |
<1h> |
1.25E234 |
"1.25E234" |
Complex number |
1 |
<2h> |
(1.23548698,2E-245) |
"(1.23548698,2E-245)" |
String |
2 |
<3h> |
"ABC" |
C$ 5 "ABC" |
|
|
|
"A C" |
C$ 7 &"A B"& |
Array |
3 ou 4 |
<4h> |
[ 1 2 3 ] |
"&[1 2 3]&" |
List |
5 |
<5h> |
{ 1 A 1_kg } |
"\47A20........" |
Global name |
6 |
<6h> |
'A' |
"vA" |
|
|
|
'A B' |
"&vA B&" where "v" is ASCII 120 |
Local name |
7 |
<7h> |
'A' |
"£A" |
|
|
|
'A+B' |
"&£A+B&" |
Program |
8 |
<8h> |
<< SWAP >> |
"\D9D20........" |
Expression |
9 |
<9h> |
'A*X^2+B*X+C' |
"'A*X^2+B*X+C'" |
Binary integer |
10 |
<Bh> |
# 3223h |
"#3223h" |
Graphic |
11 |
<Ch> |
Graphic 1 x 1 |
"&GROB 1 1 00&" |
Tagged object |
12 |
<Dh> |
:1: A |
"\CFA20........" |
Unit object |
13 |
<Eh> |
1_kg |
"'1_kg'" |
XLIB name |
14 |
<Fh> |
XLIB 232 15 |
"&XLIB 22 15&" |
|
|
|
HEAD |
"HEAD" |
Directory |
15 |
<2Fh> |
DIR END |
"\69A20........" |
Library |
15 |
<8Fh> |
Library 502: EXT49... |
"\04B20........" |
Backup |
17 |
<9Fh> |
Backup A |
"\26B20........" |
Function |
18 |
<8h> |
INV |
"INV" |
Command |
19 |
<8h> |
DUP |
"DUP" |
System integer |
20 |
<1Fh> |
<1h> |
"<1h>" |
Long real |
21 |
<3Fh> |
Long real |
"¥1.23456789012345E49999" |
Long complex |
22 |
<4Fh> |
Long Complex |
"¥(1.E-49999,0)" |
Linked Array |
23 |
<5Fh> |
Linked Array |
"\A0A20........" |
Character |
24 |
<6Fh> |
Character |
"K_A" |
|
|
|
Character |
"K_\65" |
Library Data |
26 |
<AFh> |
Library Data |
"\88B20........" |
Integer |
28 |
<FFh> |
1234567890123 |
"1234567890123" |
Font |
30 |
<CFh> |
Ft8_0:SYSTEM 8 |
"\CCB20.........." |
Flash Pointer |
27 |
<0h> |
Flash Pointer |
"\CA620.........." |
AddM: Adds the mnemonic from level 2 defined by the ROM adress from level 1 given under the form of a binary b < # 40000h. The mnemonic must not be already known, but the same adress may be associated to several mnemonics...
RnMn: Renames a mnemonic from level 2 into a new mnemonic from stack level 1.
ClrM: Clears a mnemonic given at level 1.
IdxM: Looks for n, where n is a real put on stack level 1, mnemonics containing the string given
at level 2. That string must have a size between 1 and 20.
Another possibility is to put a string at level 1 and launch IdxM : this searches for all the mnemonics
containing the string.
GetM: Generates the list of the known mnemonics of size r, r real at level 1 with r
NbMn: Gives the number of known mnemonics.
KMn?: Specifies whether a mnemonic is known of not. If yes, gives back its adress on stack level 2.
DBG: Runs the system RPL debugger. It takes a program or an XLIB name as argument. Press the "SST" function key to execute the next instruction.
With some mnemonics, you'll have to edit the source generated by DBG. Press enter when you're done, and the debugger is launched.
Stat: Provides some informations about the known mnemonics : Number of entries in ROM, number of Primitive Code Objects, Number of System-RPL Programs...
Menu502: Produces a temporary menu which carries the usual characters of EXT49 version 2.2.
LAinit: This gives the content of the 'LAmnémo' variable when no mnemonic is known. 'LAmnémo' contains the characters of the known mnemonics. The other variable stored in the hidden directory, 'inst', carries the ROM adresses of the entry points associated to the mnemonics.
To create your own new mnemonics, start with LAinit for 'LAmnémo' and an empty list for 'inst', and then define new mnemonics with 'AddM'.
It is important to remember that any character of ASCII code under 33 separates two mnemonics. To include characters of ASCII code under 33 in a mnemonic, add a "&" character before and after the mnemonic.
The unknown mnemonics encountered by ->Prg lead to an error; the unknown adresses detected by Prg-> are quoted like binaries, except the prefix, which is "$" : so, if "swap" is unknown, Prg-> can give back "$3223h".
To include unspecified binary datas, you have to add the prefix "\" before the hexadecimal sequence. To include the content of a global name into an object to compile with ->Prg, type its name after the ASCII character number 164.
Important : to prevent some problems when an error occurs, keep the calculator in " Save Last Stack " mode.
For any help or further information, contact me !