HP Forums

Full Version: About "Lastx" on HP41??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Is the lastx function on the 41cx equivalent to the lastarg on the GX?
Thanks in advance

LASTARG brings back to the stack ALL ARGUMENTS USED AND REMOVED BY LAST OPERATION. This makes LASTARG an equivalent operation, but Lastx works only with X-register contents. Lifting the stack will always happens with LASTARG, cause there is no need to preserve the topmost argument and there is no stack-lift disabling commands in the 48.

Besides the number of arguments managed by LASTARG, MODES menu allows enabling and disabling this (and other) features anytime. The major disadvantage on disabling LASTARG is that error recovering will be somewhat limited.

If there is anything else you need, e-mail again. Hope this helps.

Best regards.

I have a program in my 41cx that i am trying to convert to the 48gx. so wherever i see lastx, could i replace it with lastarg?

thank you.

Only if the operation before Lastx is a one-number function, like 1/x, SIN, e^x, or if it uses and changes X-register contents, like CLX (unusual, but valid). In these cases, LASTARG will bring the previous Level 1 argument, and the procedure will work fine. Otherwise, LASTARG can fill-in levels 1, 2 and even 3, if previous command removes them. As an example, try filling the stack with, say, 5 different arguments (numbers, lists, programs, etc.). Press LEAR and than LASTARG. See? All of them are back. If you try CLST in the HP41, LastX will bring the last X-register value used by a modifying function. CLST does not update or clear Lastx register.

It is much important being aware of these facts when translating programs from the HP41 to the HP48 (this is the English-version of the title of my book, "Da HP41 para a HP48", written in Portuguese and edited in Brazil, only). Anyway, I can try helping you with specific topics, if needed.

E-mail me.

Only if the operation before Lastx is a one-number function, like 1/x, SIN, e^x, or if it uses and changes X-register contents, unlike CLX (unusual, but valid). In these cases, LASTARG will bring the previous Level 1 argument, and the procedure will work fine. Otherwise, LASTARG can fill-in levels 1, 2 and even 3, if previous command removes them. As an example, try filling the stack with, say, 5 different arguments (numbers, lists, programs, etc.). Press CLEAR and than LASTARG. See? All of them are back. If you try CLST in the HP41, LastX will bring the last X-register value used by a modifying function. CLST does not update or clear Lastx register.

It is much important being aware of these facts when translating programs from the HP41 to the HP48 (this is the English-version of the title of my book, "Da HP41 para a HP48", written in Portuguese and edited in Brazil, only). Anyway, I can try helping you with specific topics, if needed.

E-mail me.

I have used a bad example this time. CLEAR does not save arguments, as CLST and CLX in the HP41. Only functions and commands save arguments. Try a simple + with two numbers and LASTARG will bring both back.

Sorry for the confusing example.

I forgot placing my e-mail address.

About the confusion, there is another error-recovering feature available in the previous 48S/SX that was LAST-STACK. I sometimes have to test for checking which arguments will LASTARG bring back to the stack, cause LAST-STACK is not the same as LASTARG.

Flag -55 controls whether or not arguments will be saved by commands in the HP48G.

thanks for taking the time. gobin

Hi,

you could even do it the 'hard' way:
Install the HP-41 emulator for the HP-48G series,
and run your HP-41 programs from inside the emulator...

Regards,

Raymond

Gobin,

And another way (an array of "ways" being the curse of all programming efforts) is to use the vectored input feature. This feature allows you to by-pass the normal ENTER input parsing for one you design yourself. The disadvantage is that it's a slow feature. I don't use it myself, so you need to consult your manual for details that I'm sure to omit if I try to post from memory (my memory!).

Joe

I am trying to find the LEX file that provides the KEYBOARD IS command for the HP-71B. The file in the hpmuseum ftp site (ftp://ftp.hpmuseum.com/lif/swap/chhu06/keyboard.l71) does not appear to work. It messes up the HP-71B so bad, that only a hard memory lost will fix it (INIT 3).

Does anyone have this LEX file or a procedure that allows external (HP-IL) devices to act as HP-71B keyboard.

Thanks

**vp