HP41 programming.



#6

Pardon my ignorance but can somebody give me a good example of what Indirect Addressing is all about. Seems to me that it would be just as efficient to do it by Direct Addressing.


#7

okay, imagine a menu for a PIM.

option 1 runs subroutine 01 (LBL 01), which allows you to enter a new contact.

option 2 runs a subroutine (LBL 02) to delete a contact

option 3 runs a subroutine (LBL 03) to search for a contact.


you get the value into the X register, and then you
XEQ IND ST X

(execute function pointed to by the value in X)

#8

Very simple example: Clear registers 00 to 10:

01 LBL"CLR"
02 .010
03 0
04 LBL 00
05 STO IND Y
06 ISG Y
07 GTO 00
08 END

Now, doing that with direct addressing means you would have
ten stores. Even better, this code could actually take
in X the start and end register, so you have full
flexibility. That isn't even practically possible with
direct addressing.

You can do any number of things with indirect addressing.
The point is that it is what you use when you don't know
which register you really want, or if you want to do
something with a number of registers.


#9

Hi, Jhonny;

your example made me remember one CX-only feature: CLRGX. Do you have an HP41CX? Your very good example of how to use indirect addressing as for accessing registers contents would be like this in an HP41CX:

.01
CLRGX
and that's all. CLRGX is available only in the HP41CX, but I do not know if those unusual module (HEPAX, CCD, ADVANTAGE, PPC, PANAME) also have it; the X-Functions doesn't.

Cheers.


#10

Me?
Yes, I have a fullnut CX. I also have two X-mem
built in, as well as the ZENROM.
Then I have the barcode reader, magnetic cards,
HPIL, X IO, Advantage Pac, MLDL, Cassette station and
video interface.
I only miss an IL printer, floppy disk and RS-232 interface,
and I'd be totally happy.

Oh, and of course my batteries for the cassette
station are going bad. I'll have to try doing something
about them one day...

About the programming example; I was aware of the fact
that the CX have a function for the thing I wrote, but
it was about the easiest program example I could think
of that really showed a case where you really do something
useful which cannot easily be done without indirect
addressing.


Possibly Related Threads...
Thread Author Replies Views Last Post
  Custom Programming vs. Pre-packaged programming Eddie Shore 3 376 01-24-2005, 03:42 AM
Last Post: Karl Schneider
  hp41 programming questions Fulcrum 5 405 04-25-2004, 06:34 PM
Last Post: Miki Mihajlovic
  HP41 Programming challange Harry (Germany) 22 1,361 07-28-2003, 04:50 PM
Last Post: Harry
  RPN/RPL and the HP41 Programming Language Vieira, Luiz C. (Brazil) 3 326 11-10-2001, 02:56 PM
Last Post: Andrés C. Rodríguez (Argentina)

Forum Jump: