The following warnings occurred:
Warning [2] Undefined array key 102096 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 102098 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 102103 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 102104 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 102121 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 102098 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 102121 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





HP-41C Commands to RPL



#6

I have a quick question. As a part of working on the Prime numbers Program discussed early last week, is there a source somewhere that can demonstrate HP-41C commands translated to HPL commands? I'm specifically trying to duplicate commpand such as:

ST+ 00
RCL IND 01
STO Z
ISG 01
ST- 01
ST* IND 01

So I'm trying to duplicate indirect storage, increment registers (which could be duplicated with loop structures), and stack arithmetic with indirect storage. Finally, how do you duplicate register T's behavior of duplication when the stack drops?

Thanks,

Gerry


#7

Suggestion: Use [pre] and [/pre] around code when you post it. See the advanced formatting techniques.

I expect that your code was meant to look like:

ST+ 00
RCL IND 01
STO Z
ISG 01
ST- 01
ST* IND 01

Regards,
James

#8

On an RPL model, storage is implemented with named variables,
either local or global.

With the variable-depth stack of RPL, you don't really have to use
variables to store values for later use if you don't want to; you
could leave them on the stack and use stack manipulation commands
to copy or move them to where they're needed. That said, it's
often easier to use local variables.

Any variable, either local or global, can be incremented with the
INCR command or decremented with the DECR command.

Of course values can be incremented with loops too. Within any
loop, you can increment a variable with the INCR command, or a
value on the stack just by adding 1 to it.

With a FOR loop, the loop index is implemented as a local
variable, with the name specified by the user, and accessible by
name within the loop. A FOR...NEXT loop always increments the
index, and with a FOR...STEP loop, the index is increased or
decreased by a user-specified value. START loops are similar, but
the loop index isn't accessible with UserRPL.

I'm not certain what you mean by "stack arithmetic with indirect
storage", but the RPL models do include the commands STO+, STO-,
STO*, and STO/, which work with any variable, local or global. For
example, to subtract 1 from a variable's value, use 'name' 1 STO-,
or to subtract the variable's value from 1, use 1 'name' STO-.

Offhand, I don't see any way to really duplicate the downward
replication of the T register. You could store a value in a
variable (again, local or global) which can furnish an endless
supply of the value simply by calling the variable by name.

Other than that, DEPTH PICK will always copy the topmost stack
level down to level 1. If you want it on level 2 instead, then use
DEPTH PICK SWAP, or for level 3, DEPTH PICK ROT ROT, or on a 49
series, you can replace ROT ROT with UNROT, or for level 4, DEPTH
PICK 4 ROLLD, or for level 5, DEPTH PICK 5 ROLLD, and so on.

Or you could "pre-load" the stack with several copies of an
object. For example, to put 20 copies of the number 5 on the
stack, you could do 1 20 START 5 NEXT. On the 49 series, you could
use the NDUPN command instead, for example, 5 20 NDUPN DROP.

Which RPL model are you using?

Regards,
James


#9

Out of curiosity, I just checked something. STEP will accept a value of 0, making an "endless" FOR...STEP or START...STEP loop. Of course, depending on what else is in the loop, the calculator may eventually run out of memory, or it can be ended with with CANCEL or ATTN keypress.

Regards,
James


#10

James:

Thanks for the response. I own a 48GX, 49g, 49g+ and a 50g. I want to convert the 41C Prime Number program to RPL and I was thinking the first step is to convert the 41C commands to RPL. This Prime Number program isn't all that complex, it's just convoluted to keep it short and fast but makes it hard (for me anyway) to analyze.

I just had a thought. Do any of the 41C emulators allow you to single step through a program while monitoring the stack as well as data registers? Right now I'm doing this by hand and it's a pain in the butt. But if a 41 emulator will display the stack and critical registers on a PC screen, then I can watch how the program works without killing more trees.

Thanks,

Gerry


Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing RPL programs on OS X Sean Freeman 18 5,036 11-30-2013, 03:59 PM
Last Post: Sean Freeman
  48G vs 49G+ User RPL Speed Comparison John Colvin 7 2,536 11-16-2013, 10:07 PM
Last Post: Han
  RPL 32 David Hayden 4 2,027 11-11-2013, 11:34 AM
Last Post: David Hayden
  HMS commands Geoff Quickfall 6 2,239 10-14-2013, 06:27 PM
Last Post: Tim Wessman
  Programming with CAS commands (e.g., arcLen) Helge Gabert 8 2,253 10-01-2013, 04:08 PM
Last Post: Helge Gabert
  HHC / HP Museum Programming Contest for RPN and RPL machines Gene Wright 18 5,445 09-22-2013, 09:39 AM
Last Post: Miguel Toro
  [HP-Prime xCAS] Arrays: Programming Commands (solution to the ambiguity) CompSystems 6 2,491 08-30-2013, 06:32 PM
Last Post: CompSystems
  [HP Prime CAS] Solve Commands (Bugs and Request) CompSystems 10 3,774 08-08-2013, 12:34 PM
Last Post: Gilles Carpentier
  HP 85A. GET and SAVE commands. inaki 6 2,076 06-05-2013, 06:45 AM
Last Post: Paul Berger (Canada)
  CAS hp50g non equivalent commands peacecalc 0 855 12-16-2012, 02:47 PM
Last Post: peacecalc

Forum Jump: