The following warnings occurred:
Warning [2] Undefined array key 215741 - 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 215743 - 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 215766 - 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 215767 - 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 215768 - 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 215789 - 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 215805 - 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 215849 - 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 215768 - 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 215849 - 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 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





15C programming question



#3

Routine A dimensions matrices A,B, and sets result to C.
Routine E multiplies AxB.

Without the second (repeated) RTN on line 22, the program does not return to 000, but will continue through and multiply AxB. What am I doing wrong here?

001- 42,21,11 LBL A

002- 2

003- 36 ENTER

004- 2

005- 42,23,11 DIM A

006- 2

007- 36 ENTER

008- 1

009- 42,23,12 DIM B

010- 42,26,13 RESULT C

011- 42,16,1 MATRIX 1

012- 0

013-u 44 11 STO A

014- 1

015-u 44 11 STO A

016- 1

017- 16 CHS

018-u 44 11 STO A

019- 0

020-u 44 11 STO A

021- 43 32 RTN

022- 43 32 RTN

023- 42,21,15 LBL E

024- 45,16,11 RCL MATRIX A

025- 36 ENTER

026- 45,16,12 RCL MATRIX B

027- 20 Multiply

028- 43 32 RTN

Edited: 27 Mar 2012, 2:08 p.m.


#4

Step 20 follows the "do if true" paradigm of the conditional and looping commands. It does the STO, increments the counters, and skips the next step if it had gone past the matrix boundary.


#5

Thanks. I found it in the manual. That's a very nice feature, actually.

#6

Pardon my ignorance, but what are the lower-case "u"s preceding the 44 11 STO commands in the listing.


#7

means they were keyed in while in USER mode.

Changes the behavior of some commands related to matrix, etc.


#8

Bonjour,

This topic is a good reason, actually a good excuse, to practice and remind me some of my HP-15C's code.


That's how I read the proposed code and interprets its progress. Feel free to comment and report any oversight or misinterpretation.

  Key Code       MNEMOMICS              Merge Commands     Remarks

001-42,21,11 LBL A "A" Sub-program "A"
002- 2 2
003- 36 ENTER
004- 2 2
005-42,23,11 DIM A (2,2) DIM A Dimension Data Matrix A to 2x2
006- 2 2
007- 36 ENTER
008- 1 1
009-42,23,12 DIM B (2,1) DIM B Dimension Data Matrix B to 2x1
010-42,26,13 RESULT C Result in C Designates Matrix C for storing result
011-42,16, 1 MATRIX 1 Matrix Entry Restart entry from home position (1,1)
012- 0 0
013-u 44 11 STO A A(1,1) <-- 0 Matrix A Entry
014- 1 1
015-u 44 11 STO A A(1,2) <-- 1
016- 1 1
017- 16 CHS
018-u 44 11 STO A A(2,1) <-- -1
019- 0 0
020-u 44 11 STO A A(2,2) <-- 0
021- 43 32 RTN ............ step skiped since 'End of Matrix reached' (roll over)
022- 43 32 RTN End of "A"

023-42,21,15 LBL E "E" Sub-Program "E"
024-45,16,11 RCL MATRIX A
025- 36 ENTER ? ? ?
026-45,16,12 RCL MATRIX B
027- 20 × C <-- A × B Matrix Product
028- 43 32 RTN End of "E"


#9

Hi;

I'd just add a few remarks, if you allow me to:

  Key Code       MNEMOMICS              Merge Commands     Remarks

001-42,21,11 LBL A "A" Sub-program "A"
002- 2 2
003- 36 ENTER
004- 2 2 (unnecessary)
005-42,23,11 DIM A (2,2) DIM A Dimension Data Matrix A to 2x2
006- 2 2 (unnecessary)
007- 36 ENTER (unnecessary)
008- 1 1
009-42,23,12 DIM B (2,1) DIM B Dimension Data Matrix B to 2x1
010-42,26,13 RESULT C Result in C Designates Matrix C for storing result
011-42,16, 1 MATRIX 1 Matrix Entry Restart entry from home position (1,1)
012- 0 0
013-u 44 11 STO A A(1,1) <-- 0 Matrix A Entry
014- 1 1
015-u 44 11 STO A A(1,2) <-- 1
016- 1 1 (unnecessary)
017- 16 CHS
018-u 44 11 STO A A(2,1) <-- -1
019- 0 0
020-u 44 11 STO A A(2,2) <-- 0
021- 43 32 RTN ............ step skiped since 'End of Matrix reached' (roll over)
022- 43 32 RTN End of "A"

023-42,21,15 LBL E "E" Sub-Program "E"
024-45,16,11 RCL MATRIX A
025- 36 ENTER ? ? ?
026-45,16,12 RCL MATRIX B
027- 20 × C <-- A × B Matrix Product
028- 43 32 RTN End of "E"

Step #4: after [ENTER] both X and Y registers already filled with 2.00, no need to enter again;

Steps #6 and #7: Same as above

Step #16: there is a copy of 1 still in the X-register, a single CHS suffices to let -1 in the X-register

And you are correct: step #25 is not needed.

Since the elements and the indexes for the matrices are not used after their contents are set, reusing them instead of introducing them back once they are still in the memory stack reduces the number of program steps. And allow the extra few bytes to be used in other programs.

Cheers.

Luiz (Brazil)


Edited: 28 Mar 2012, 5:52 a.m.


#10

You are welcome ! :-)


Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple? programming question [WP34S] Shawn Gibson 3 1,414 03-15-2013, 11:56 AM
Last Post: Didier Lachieze
  WP-34S Programming Question Matt Agajanian 2 1,222 08-04-2012, 02:04 PM
Last Post: Matt Agajanian
  WP 34S programming question Nigel J Dowrick 35 7,982 04-10-2012, 02:23 AM
Last Post: Walter B
  HP 15c question about [ENTER] nina scholz 5 1,774 03-29-2012, 10:13 AM
Last Post: M. Joury
  15C keyboard question Matt Agajanian 7 2,172 03-28-2012, 02:18 AM
Last Post: Dwight Sturrock
  HP 15C LE programming, does CPU run fast? designnut 1 1,062 02-12-2012, 05:13 PM
Last Post: Jeff O.
  HP 15C Programming Tutorial Posted Eddie W. Shore 2 1,130 12-14-2011, 12:40 PM
Last Post: Thomas Klemm
  Original 15C Keyboard Test Works With 15C LE!!! DigiGal 5 2,130 09-26-2011, 07:33 PM
Last Post: M. Joury
  Long term storage question on 15C LE nick lidakis 4 1,626 09-12-2011, 01:35 AM
Last Post: Peter Murphy (Livermore)
  HP-15C, an interesting question robert rozee 21 4,636 02-20-2011, 04:11 PM
Last Post: Walter B

Forum Jump: