Post Reply 
Multi (i) register techniques help, please.
06-03-2018, 06:15 PM
Post: #15
RE: Multi (i) register techniques help, please.
(05-31-2018 06:58 PM)Dieter Wrote:  
(05-31-2018 06:09 PM)Matt Agajanian Wrote:  For example, consider how matrix operations are calculated given that the elements for say, inversion or martrix multiplication are using elements in different matrix positions and thus, different register locations.

Yes, matrices are a truly classic application for multiple index registers. That's why I didn't start writing such programs before I had an HP-41. ;-)
Dieter

Hi, I found something from the past: nested loops with one index register for HP-15C (I have not checked Wink I am sure it can be optimize, but maybe it give some idea for somebody):

Quote:Nested loops
Message #9 Posted by Tizedes Csaba on 11 July 2003, 11:00 a.m.,
in response to message #8 by Tizedes Csaba
Hi All!

I wrote this program about four years ago.

General method:

Code:

--------
LBL 0
1
STO I
--------
LBL 1
RCL RR2
STO 2
1
STO + I
--------
LBL 2
RCL RR3
STO 3
1
STO + I
--------
  .
  .
  .
--------
LBL n-1
RCL RRn
STO n
1
STO + I
--------
LBL n
#######################
#                     #
# Loop's instructions #
#                     #
#######################
ISG (i)
GTO I
--------
LBL decrement
DSE I
GTO jump
RTN
--------
LBL jump
ISG (i)
GTO I
GTO decrement
--------

RR2, RR3, ..., RRn contains original value of loop counters (2nd, 3rd, ..., nth registers of calculator) Before running it must be set.

An example: Calculate how many 3*4*5:

Code:

LBL 1
RCL 5
STO 2
1
STO + I
LBL 2
RCL 6
STO 3
1
STO + I
LBL 3
1
STO + 0
ISG (i)
GTO I
LBL 8
DSE I
GTO 9
RCL 0
RTN
LBL 9
ISG (i)
GTO I
GTO 8
For running:

1.003 STO 1
1.004 STO 5
1.005 STO 6
1 STO I
GSB 1

Csaba
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Multi (i) register techniques help, please. - Csaba Tizedes - 06-03-2018 06:15 PM



User(s) browsing this thread: 1 Guest(s)