HP Forums
41-MCODE: IND/ST/MATH in prompting - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: 41-MCODE: IND/ST/MATH in prompting (/thread-156291.html)



41-MCODE: IND/ST/MATH in prompting - Ángel Martin - 09-14-2009

Greetings,

I'm looking for information on how's the coding done for prompting functions using the extra options, like IND, ST, IND_ST, and MATH.

It's easy for the standard and simple IND cases, but how about the rest? This should be well know to the community but I can't trace the information anywhere - got no VASM listings myself :(

1.- Standard: reg# address in S&X field of A

2a.- IND: (reg# + 80) in S&X field of A

2b.- IND ST

3.- ST (X/Y/Z/T/L...)

5a.- MATH (+/-/*//)

5b.- MATH IND

5c.- MATH IND ST

Cheers,

ÁM

Edited: 14 Sept 2009, 5:27 a.m.


Re: 41-MCODE: IND/ST/MATH in prompting - Meindert Kuipers - 09-14-2009

Angel,

The VASM listings are a must, and they are on the various DVD's.
The listing below is from my disassembler and it has the 2 bits of the last words of the function name combined in the prompt variable, hope this helps!

case prompt of
$00 : Cmt := ''; // no prompting
$01 : Cmt := 'Prompt: Alpha (null input valid)';
$02 : Cmt := 'Prompt: 2 digit ST IND IND_ST + - * /';
$03 : Cmt := 'Prompt: 2 digit or non-null Alpha';
$11 : Cmt := 'Prompt: 3 digits';
$12 : Cmt := 'Prompt: 2 digits ST IND IND_ST';
$13 : Cmt := 'Prompt: 2 digits IND IND_ST non-null Alpha';
$21 : Cmt := 'Prompt: non-null Alpha';
$22 : Cmt := 'Prompt: 2 digits IND IND_ST';
$23 : Cmt := 'Prompt: 2 digits or non-null Alpha';
$31 : Cmt := 'Prompt: 1 digit IND IND_ST';
$32 : Cmt := 'Prompt: 2 digits IND IND_ST';
$33 : Cmt := 'Prompt: 2 digits IND IND_ST non-null Alpha . ..';

Meindert


Re: 41-MCODE: IND/ST/MATH in prompting - Ángel Martin - 09-14-2009

Thanks Meindert, sorry I didn' t explain it better but the issue is not with the coding of the function NAMES (using the leftmost bits of the first two function name bytes as per the table you attached) but with the way the actual values are coded when used.

For instance. I have not figured out where is the input "IND ST Y" stored when using such a prompt. Not in the S&X field of the A register, which only "knows" about the IND part but not about the ST... mystery or plain ignorance on my part? Likely the latter...

Best,
'AM




Re: 41-MCODE: IND/ST/MATH in prompting - Meindert Kuipers - 09-15-2009

That will be more difficult, you will have to look for examples using the various types of prompting. If you have a copy (also on the DVD's) of Ken Emery's famous HP41 M Code For Beginners, there is a nice introduction on page 135 and on which should get you started.

Meindert


Re: 41-MCODE: IND/ST/MATH in prompting - Eric Smith - 09-15-2009

Is the A S&X field formatted as a postfix byte? If so, isn't the "ST Y" implicit in the postfix value? If not, how are you finding that "IND" is indicated?

If I had to make a wild-ass guess, I'd think that any additional information from prompting might be stored in the "Q" status register. That's where alpha prompting goes, but maybe numeric prompting affects it also.


Re: 41-MCODE: IND/ST/MATH in prompting - Håkan Thörngren - 09-15-2009

A stack argument is stored in the postfix byte of the function, just like numeric registers. Low numbers are for data registers, while higher numbers (112-127) are for stack / status registers. The quick reference card for synthetic programming shows the coding, for example 112 is T register, add 128 for IND T.

Math STOre functions are encoded in the prefix byte, postfix bytes works the same as all others.