Post Reply 
Compiling Gjermund's solution to Valentin's SRC #012a - Then and Now: Probability
02-18-2023, 04:21 PM
Post: #1
Compiling Gjermund's solution to Valentin's SRC #012a - Then and Now: Probability
(02-17-2023 05:49 AM)kostrse Wrote:  Sorry, I'm trying to compile it on my HP-50G and it complains at the GOSBVL (Invalid Syntax). Is it a SysRPL or Assembly instruction or what?

GOSBVL is a Saturn assembly opcode that executes the subroutine identified by the symbol given as an argument. In particular, it is used when the address of the subroutine requires a "very long" jump (hence the VL in the name).

I've tried a variety of things to replicate that error, but have been unable to do so. That said, I have a couple of questions that may help to track down what you are experiencing:
  1. Which version of the extable are you using? What port is it stored in?
  2. How are you invoking the compiler?
While the 49-50g series has a built-in Saturn/SysRPL compiler, using it requires the installation of an extable containing the symbols and addresses that are appropriate for the targeted host platform. Gjermund's program uses one particular SysRPL command that is not defined in the standard HP extable: #>=_

Successfully compiling his code therefore requires one of two scenarios:
  1. You add a declaration of the missing symbol to the source code (my preferred method when there's only a small number of missing symbols), or
  2. You use an extable that already has the missing symbols included (my preferred method when there are more than a few symbols needed)
Since there is only one missing symbol in this case, I would recommend the first scenario. This will simply require adding the symbol definition to the beginning of the source code (ie. immediately before the "!RPL" line):
Code:
!ASM
  DC #>=_     3747D





(02-17-2023 05:49 AM)kostrse Wrote:  What should I do to make it work on a stock calculator?

Starting from a "fresh out of the package" 50g, the following steps should work:
  1. Set the 50g to RPN mode Smile
  2. Install the standard HP extable for the 50g (I usually store it in port 2)
  3. Warmstart the calculator with ON-C so that the extable can attach itself
  4. Place the source code in stack level 1 as a string. Make sure that the "@" is the absolute last character in the source code, as any trailing spaces/linefeeds/carriage returns/etc. will cause a compiler error.
  5. Execute "256.06 MENU" to bring the appropriate Developer Tools menu items into context.
  6. Press the function key associated with ASM.
The compiled program should now exist on the stack in level 1.
Find all posts by this user
Quote this message in a reply
02-20-2023, 04:02 AM
Post: #2
RE: Compiling Gjermund's solution to Valentin's SRC #012a - Then and Now: Probability
Thank you for explanation, didn't work with SysRPL before.

Initially I was trying to just remove double quotes and save it on stack as a problem, but it didn't work.

EXTABLES library and ASM command from the Developer Tools worked for me.
Find all posts by this user
Quote this message in a reply
02-22-2023, 08:04 AM
Post: #3
RE: Compiling Gjermund's solution to Valentin's SRC #012a - Then and Now: Probability
Hi
I've been away a few days, good to know you were able to compile it.

Best regards
Gjermund
Find all posts by this user
Quote this message in a reply
Post Reply 




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