The following warnings occurred:
Warning [2] Undefined array key 91852 - 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 91859 - 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 91862 - 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 91863 - 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 91864 - 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 91865 - 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 91867 - 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 91869 - 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 91874 - 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 91958 - 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 91865 - 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 array key 91869 - 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 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 91874 - 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 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 91958 - 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 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-41 programming language improvements?



#11

Has anyone made any MCode routines where a conditional would jump two steps on a "no" instead of one?

Alternatives could be:

x=0?2

x>y?2

fs?2 01

dse2 00

... on "yes", go to next step; on "no" skip two steps.

I have had a dozen places in my code recently where this would be very useful.


#12

How about using a special register to indicate the number of steps to jump, so one is not limited by one or two steps?


#13

Hi,

these n-step conditional jumps would be easily implemented,

but IMHO they don't really make sense,

since you already have a way to 'simulate' this behaviour.

Just use a GTO or XEQ to a suitable subroutine

which performs the n-step statement,

right after the conditional statement.

Like:

..

ISG 00

XEQ 00

..

..


LBL 00

.. (here you have n steps)

RTN

Another idea would be to rewrite/optimize the FOCAL code

so that it doesn't need multiple statements

in the condition=true case.


Raymond


#14

Good point. I do like the XEQ option since it needs less labels than a GOTO solution.

I also agree with Bram about readibility.

I am also thinking of a new version of an HP-41-based interpreter. By this I mean running an RPN language that should be familir to HP-41C users. I was thiking of multi-statement lines that might also work with conditional tests. here is an example:

x=0?

STO 00; STO* 02; 1; STO+ 01

That works ok until someone wants to put an XEQ statement (or even another test) after the test. I may limit this muti-line feature to statements that do not alter program flow. Otherwise, one can use the more familiar coding style.

Other features of the inerpreter are local and global variables and labels. This feature allows the developme of modules that use their own labels and variables without colliding with similarly named variables in other modules. The global varables allows the modules to share data. The global labels provides multiple entry points to a module.

Namir



Edited: 2 May 2006, 6:48 a.m.

#15

Quote:
How about using a special register ...

nice consideration, but flexibility at the price of readability. The 2 jump tests will be clear enough, but with the N jump test you'll have to keep track of the register contents. Difficult to tell when you store something in it in the program itself.

I myself have only occasionally needed such special constructs. Even on the limited HP-29C there has always been an easy work around.



just my experiences ...


#16

This Message was deleted. This empty message preserves the threading when a post with followup(s) is deleted. If all followups have been removed, the original poster may delete this post again to make this placeholder disappear.


#17

Skipping multiple lines is very simple (and can be useful indeed). The trick is to invert the test that you want to do (FS? instead of FC? for example), and then add an instruction to skip multiple lines. The functions are in ML ROM (can be downloaded from www.kuipers.to/support), the listing is below. Just add J2, J3 or J4 after the test. Can easily be expanded to any number of lines, just be careful not to jump further than the END.

F 0834 158 ... ... M=C
F 0835 141 0A4 ... ?NC XQ 2950 GETPC
F 0837 3E5 0A8 ... ?NC XQ 2AF9 SKPLIN
F 0839 0DD 08C ... ?NC XQ 2337 PUTPC
F 083B 198 ... ... C=M
F 083C 266 ... ... C=C-1 S&X
F 083D 3BB ... ... JNC -09 0834
F 083E 3E0 ... ... RTN

FUNCTION 0E05 ... ... ... "J2"
F 0E05 130 001 ... LDI 001
F 0E07 053 ... ... JNC +0A 0E11
FUNCTION 0E0A ... ... ... "J3"
F 0E0A 130 002 ... LDI 002
F 0E0C 02B ... ... JNC +05 0E11
FUNCTION 0E0F ... ... ... "J4"
F 0E0F 130 003 ... LDI 003
F 0E11 158 ... ... M=C
F 0E12 389 08C 035 GOTO 0835

Edited: 2 May 2006, 7:37 a.m.

#18

Hi Geir,

Your first and second examples, X=0?2, X>Y?2, would be fairly simple to write. Study the mainframe code at:

1619 NOSKP

162E SKP

to see how HP does it. There are three cases: 1) keyboard execution (YES or NO displayed), 2) SST (F51) and 3) running (f13).
The problem with this type function is that there are so many of them, one could quickly fill up a FAT with short routines.

fs?2 01

dse2 00

These are another problem entirely. It is impossible to merge the postfix with the prefix so these would be two lines each, eg. skip two or three lines. One could write a function like DSE00?2 as a single line yet it would work only with register 00. So if one needed something like ISG2 37 it would require four bytes of ram, which is probably not an improvement!

Sometimes it is necessary to use unmerged functions, last year Angel Martin asked me to write a subroutine for his complex rom functions ZSTO, ZRCL and Z<>. These functions can now take an argument which follows on the next line, eg. ZSTO 27 using two lines. His functions also work from the keyboard, which was a surprize to me. The trick he showed me is to use a programmable entry (non-null first word) with a mainframe prompt.

Best

Edited: 2 May 2006, 4:32 a.m.


#19

Doug's implementation of the two-line functions remains a best in class example, even better than those found in the HEPAX module I believe.

So one idea here would be writing a "generic" conditional function that would take the number of skipped lines as argument -yet the register to act the conditional upon will be another argument... too much!

Meindert's examples are another possibility. The SKIP2 and SKIPN functions are also around in some custom module images...

Best,

ÁM.

#20

A workaround may be the following sequence:

cf 1
x>0?
sf 1
fs? 1
..
fs? 1
..
fs? 1
..
Marcus

Possibly Related Threads…
Thread Author Replies Views Last Post
  Improvements for productivity for the Prime Stefan Dröge (Germany) 2 1,731 12-08-2013, 05:11 AM
Last Post: Stefan Dröge (Germany)
  HP-41(CL): The easiest way to transfer FOCAL programs from a Linux PC to the HP-41 Geir Isene 13 5,555 12-05-2013, 02:40 AM
Last Post: Hans Brueggemann
  HP 41 Advanced Programming Tips Michael Fehlhammer 0 1,150 11-28-2013, 06:11 PM
Last Post: Michael Fehlhammer
  Programming CMT EPROM modules for HP-41 Paul Berger (Canada) 4 1,872 01-22-2013, 06:04 PM
Last Post: Paul Berger (Canada)
  HP-41 CMT EPROM & ZEPROM Programming Dan Grelinger 3 1,437 11-26-2012, 02:42 AM
Last Post: Diego Diaz
  HP 75 Assembly Language Michael Fehlhammer 7 2,379 10-01-2012, 08:32 AM
Last Post: Michael Fehlhammer
  Survey: Best programming language for next-gen HP? Oliver Unter Ecker 32 8,356 06-06-2012, 03:22 PM
Last Post: David Hayden
  HP-17B Language selection disappeared. Kees van der Sanden 10 2,688 02-13-2012, 10:51 PM
Last Post: bill platt
  Calculator natural language user interface Donald Williams 12 3,504 01-07-2012, 09:45 AM
Last Post: Vince (Italy)
  hp 41 synthetic programming Sok-khieng Chum Hun 7 2,530 05-15-2011, 01:09 AM
Last Post: Sok-khieng Chum Hun

Forum Jump: