The following warnings occurred:
Warning [2] Undefined array key 57148 - 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 57175 - 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 57175 - 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 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





Do nothing at $20005 (HP-42S Assembly programming)



#2

Hi!

I have recently started to look at the possibility to program the HP-42S in Saturn Assembly. One of the first tasks I have been been trying to achieve is to return safely to the RPN context from the language ROM area, called by the XFCN (therefore the subject of this posting: "Do nothing at $20005").

The snippet below seems to work fine in Emu42 (I have also tested it on a rev A HP-42S with the 2 x 32K RAM upgrade as suggested by Nelson M Sicuro), but is this the correct way to do this?

* Language ROM Detect Constant
CON(5) #5AC3F
* Return to RPN context, drop one stack level
A=C A
C=RSTK
C=A A
A=DAT0 A
D0=D0+ 5
* Rev A = 10D5F, Rev C = 10DE1
GOVLNG #10D5F

Or just entered directly into the monitor:

20000: F3CA5DA07D61421648DF5D01 (Rev A)
20000: F3CA5DA07D61421648D1ED01 (Rev C)

Best regards,


Erik Ehrling (Sweden)


Homepage:http://www.hp42s.com


#3

Hello Erik,

Don't do anything except GOVLNG #10DE1 (or #10D5F) because D0 points to the next byte of the instruction and not to the next RPL address! In the case of XFCN (and all instructions from this category), D0 points to the first byte of the alpha argument.

For example, if you execute XFCN "ABCDEF", D0 points to F7 F1 41 42 43 44 45 46 sequence of bytes. You don't have to restore D0 or manipulate (drop anything from) the return stack in your code because the firmware will do this for you.

BTW, I am usually returning with GOVLNG #15D8A (Rev C) which is the same as =xNEXT (#10DE1) but it enables stack lifting as well.

Best regards.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP 42s programming help for novice Carl D (new) 4 1,567 02-02-2013, 11:39 PM
Last Post: Mike Morrow
  HP 75 Assembly Language Michael Fehlhammer 7 2,383 10-01-2012, 08:32 AM
Last Post: Michael Fehlhammer
  Re: RPN Programming exercise (HP-42S) Gerson W. Barbosa 1 1,014 02-27-2012, 05:51 PM
Last Post: Marcus von Cube, Germany
  RPN Programming exercise (HP-42S) Gerson W. Barbosa 71 13,196 02-26-2012, 11:48 AM
Last Post: Valentin Albillo
  42s questions and 42s vs 35s snaggs 13 5,192 09-19-2011, 02:44 AM
Last Post: snaggs
  Programming HP-42S Howard Jones 2 981 10-17-2009, 06:47 PM
Last Post: Howard Jones
  HP 42S Programming Howard Jones 3 1,182 10-08-2009, 11:21 AM
Last Post: Vieira, Luiz C. (Brazil)
  Book for learning 41/42s programming? Keith Beyer 8 2,156 11-14-2008, 09:12 AM
Last Post: Nigel J Dowrick
  HP-42S, 41CX and synthetic programming thoughts Vincent Weber 0 849 06-25-2008, 09:13 AM
Last Post: Vincent Weber
  HP-10 Dis-assembly Jeff Davis 2 1,128 03-24-2008, 09:20 AM
Last Post: Jeff Davis

Forum Jump: