Post Reply 
SystemRPL using MASD compiler
05-29-2022, 10:40 PM
Post: #1
SystemRPL using MASD compiler
I have some experience in UserRPL, but I would like to start programming in SystemRPL using the HP50g's compiler (MASD).

I want to start my SystemRPL programming journey by adding two real numbers.

I wrote the following:
Code:

"!NO CODE
!RPL
::
% 1 %+
;
@
"

When I press "ASM" key I receive an error message "asm Error: Invalid file". After I got the error message I press "ER" to understand the error.

After I press the "ER" key I get the message "label expected" and the cursor appears at the % symbol just before the "+" symbol.

Can you give some hints to understand what I am doing wrong?

What is the next step after the program is compiled?

Thank you in advance.
Find all posts by this user
Quote this message in a reply
05-30-2022, 03:06 AM (This post was last modified: 05-30-2022 03:17 AM by Joe Horn.)
Post: #2
RE: SystemRPL using MASD compiler
Do you have Flag -92 set correctly? Clear it for assembly mode, and set for System RPL mode.

The AUR puts it this way: "Note: if the Flag –92 is set, MASD starts in !RPL and !NO CODE mode."

Appendix C describes flag -92 this way:
"Assembler Mode.
Clear: Assembler defaults to making code objects.
Set: Assembler defaults to making System-RPL programs."

EDIT: In case the above was unclear, just set flag -92 and omit the leading two lines from your program (Start with :: ). And be sure that the final character is "@", not followed by a carriage return.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
05-30-2022, 09:53 AM
Post: #3
RE: SystemRPL using MASD compiler
Remember
The very last character in the file must be "@"
no trailing spaces, no carriage returns
BR Gjermund
Find all posts by this user
Quote this message in a reply
05-30-2022, 10:22 AM (This post was last modified: 05-30-2022 10:25 AM by DavidM.)
Post: #4
RE: SystemRPL using MASD compiler
(05-29-2022 10:40 PM)Marc5278 Wrote:  When I press "ASM" key I receive an error message "asm Error: Invalid file". After I got the error message I press "ER" to understand the error.

After I press the "ER" key I get the message "label expected" and the cursor appears at the % symbol just before the "+" symbol.

That specific error at that spot leads me to believe that you probably don't have an extable installed.

In addition to the other comments, make sure that you have a suitable extable installed. This contains the official one from HP for a rev. 2.15 50g. I keep mine installed in port 2.

Once you've installed the extable, the built-in assembler/compiler (ASM) should be able to compile your code. If it succeeds, you'll get no error messages and simply see the compiled code object left in stack level 1. It should look something like "1. External" (the fraction mark depends on your calculator's settings). That code is now ready to be saved into a global variable or run directly with EVAL.

A word of warning, however: as written, your code assumes that a real (aka "approximate") number already is present in stack level 1 when it executes. If the stack contains any other kind of object (say, an exact number [ZINT]) or is otherwise empty, the calculator will either crash or be left in an unstable state that will inevitably lead to a crash. So be careful how you experiment with that particular program.

There's nothing inherently wrong with the code as written, it simply needs to be used in the proper context. It will function as I believe you intend, but only if the stack is pre-loaded with a real number before execution. I recommend that you use an emulated calculator for your SysRPL coding efforts so that you can safely (and quickly) recover from the inevitable "oops" moments that come up when developing SysRPL code.

Hope this helps!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)