The following warnings occurred:
Warning [2] Undefined array key 204772 - 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 204828 - 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 204830 - 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 204838 - 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 204830 - 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 204838 - 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 34s: Three financial routines



#5

Hi,

I posted three financial routines for the HP 34s on the Articles section, to complement the existing TVM application :

- Cash flow analysis (corrected and improved by Dieter)

- Amortization

- Nominal / Effective interest rate conversion

As always, any suggestion is very welcome.

Regards,

Miguel

Edited: 12 Nov 2011, 7:43 p.m.


#6

Hi Miguel,

I am really glad to see you using the preprocessor extension to the WP 34S assembler! That is gratifying. Your code is an excellent example of usage of the extension.

A couple of points that will help in certain cases:

1) Most importantly, if you are using this tool (wp34s_pp or the -pp switch in wp34s_asm), it is better to let the tool assign the local label names (eg: LBL 01) and use a symbolic label for the target of your SLV or XEQ statement. (Just as a reminder, and not that you violated this, but the preprocessor cannot handle duplicate local labels [ie: LBL 01]. It is usually (always?!) better to let the tool choose local labels to use itself.)

2) For ease of input you can recode most of the text strings by using double quotes. The tool will parse it and figure out the most efficient coding required. Several things, like spaces, are automatically recoded as the '[space]' equivalent. In some cases, the double quote technique will produce fewer steps than you would have gotten otherwise. Regardless of whether the output steps are identical or not, it is certainly easier to code the strings using double quotes.

3) You have a few cases where your use stretched to the tool to places it was not intended to go :-) In at least one case, you made use of a GTO with a 'soft' label (step 16 of 'CFE', for example) where it had been my intention that this technique designed for use with the pseudo JMP instruction. In a way I am glad that the GTO actually worked in this case but I don't think it was never tested (at least not extensively)! In this example, if you had used a JMP instead GTO, the tool would have decided that this could have been coded with a SKIP instruction. These JMP->SKIP promotions will save a few steps here and there because the tool would not be forced to inject a LBL for the soft-targetted GTO.

I have attached a 'diff' output between your code and a slightly modified version to show you what I mean. The first line of each diff pair is the original line(s) from your code and the second line(s) are how I modified it. I can send you the modified code as a whole if you'd like. Just let me know.

Not that the resulting compression make too much difference, but your code assembled to 317 words in total (228 steps) and my variation assembled to 314 words (again, in 228 steps). This is mostly the loss of the additional LBLs (I think).

Keep up the fine work!

280c280
< [alpha]'CF'
---
> "CF"
282,283c282
< [alpha] [^]
< [alpha] n
---
> "[^]n"
287c286
< GTO endloop
---
> JMP endloop
311,312c310
< [alpha]'CF'
< [alpha] =
---
> "CF="
346c344
< [alpha]'CF'
---
> "CF"
348c346
< [alpha] =
---
> "="
396c394
< XEQ 00
---
> XEQ calcNPV_IRR
399,400c397
< [alpha]'NPV'
< [alpha] =
---
> "NPV="
435c432
< SLV 00
---
> SLV calcNPV_IRR
447,448c444
< [alpha]'IRR'
< [alpha] =
---
> "IRR="
454,455c450
< LBL 00 // Calculates NPV and solves for IRR
< 1
---
> calcNPV_IRR:: 1 // Calculates NPV and solves for IRR
468c463
< GTO intzero
---
> JMP intzero
527,528c522
< [alpha]'Cap'
< [alpha] ?
---
> "Cap?"
533,534c527
< [alpha]'Pmt'
< [alpha] ?
---
> "Pmt?"
539,540c532
< [alpha]'Tpr'
< [alpha]'ds?'
---
> "Tprds?"
548,549c540
< [alpha]'I/P'
< [alpha]'%?'
---
> "I/P%?"
588,589c579
< [alpha]'Prd'
< [alpha]'-I?'
---
> "Prd-I?"
595,596c585
< [alpha]'Prd'
< [alpha]'-F?'
---
> "Prd-F?"
611c600
< [alpha]'Pri'
---
> "Pri"
616c605
< [alpha]'Int'
---
> "Int"
621c610
< [alpha]'Bal'
---
> "Bal"
701,702c690
< [alpha]'P-Y'
< [alpha] ?
---
> "P-Y?"
733c721
< XEQ 01
---
> XEQ calcEFF_NOM
739,740c727
< LBL 01 // Calculates EFF and solves for NOM
< RCL D
---
> calcEFF_NOM:: RCL D // Calculates EFF and solves for NOM


#7

Thank you Neil for your comments, I will make the necessary changes to incorporate them in my code and post an edited version.

Have a nice evening,

Miguel

#8

...And done!


Possibly Related Threads…
Thread Author Replies Views Last Post
  10bii Financial Calculator is on launch sale - 0.99$ only John 4 1,961 11-10-2013, 08:02 PM
Last Post: BShoring
  HP-80 Financial Calculator (1973) BShoring 3 1,646 03-25-2013, 11:39 PM
Last Post: BShoring
  Simple financial problem with a HP-12c Platinum Lapin 3 1,545 11-11-2012, 09:33 AM
Last Post: Lapin
  HP financial calculator prototypes Keith Midson 4 1,648 10-06-2012, 03:13 PM
Last Post: Harald
  Financial Calculations for the HP41: another enhanced version Luiz C. Vieira (Brazil) 0 795 04-16-2012, 09:16 AM
Last Post: Luiz C. Vieira (Brazil)
  HP-41CX and Financial Decisions Module Cheyenne Whitley 22 5,093 04-07-2012, 07:51 PM
Last Post: Garth Wilson
  HP-35A/21 D.MS<-->Decimal degrees routines Matt Agajanian 9 2,814 03-29-2012, 11:03 AM
Last Post: Matt Agajanian
  accuracy of integration and solve routines HP 15C LE Jan 3 1,348 02-02-2012, 01:03 PM
Last Post: Marcus von Cube, Germany
  [WP34s] XROM routines fhub 32 7,111 01-10-2012, 04:28 AM
Last Post: Marcus von Cube, Germany
  [wp 34s] wp 34s picture and scan Jeroen Van Nieuwenhove 2 1,126 10-27-2011, 09:02 PM
Last Post: Les Wright

Forum Jump: