HP Forums
Identifying calc type in RPL - 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: Identifying calc type in RPL (/thread-70464.html)



Identifying calc type in RPL - valentino ducati - 03-15-2005

Hi all

I'm a RPN (hp41 system) fellow. Back to that times it was fairly easy to check for memory (SIZE), peripherals (FS? 21, XROM...) and many other environment details (maybe with some synthetic commands) for a program package.

This to allow single source for hp41 with few/much memory, with or without printer, with or without X-Functions etc.

After aquiring a 48SX and two 48GX now I will give a try to the 49G+. My question:

Are there any Flag combinations or SYSEVAL or some other way to check if my program is running on a 48S, 48G or /X or 49 series? Provided it uses only backward compatible functions in the main \<< \>> brackets?

Thank you for help.


Re: Identifying calc type in RPL - Raymond Del Tondo - 03-15-2005

On the 'G' or 'g' type calcs,

you can use the keyword VERSION.

If the version returned is higher than "HP48-J", it's a G type.

If VERSION returns something with "HP49" somewhere

in the string, it's a 'g' (small G) type,
or in other words, a 49g...

The 'S' type calcs don't have the VERSION keyword.

On the S types, there exists a suitable SYSEVAL address,

which I don't recall right now.

In most cases, I used the following code,

which returns TRUE if the current machine is a G type,

or FALSE if the code is running on an S type:

*NULLNAME GX?

CODE

addrVDISP EQU #1263A

GOSBVL =SAVPTR

D1=(5) (addrVDISP)+6

C=DAT1 A

?CBIT=1 3

GOYES isGX

isGX GOVLNG =GPPushT/FLp

ENDCODE

HTH

Raymond




Re: Identifying calc type in RPL - Arnaud Amiel - 03-15-2005

And on teh 28, VERSION returns 'VERSION' at least on the S, I don't have a C so can't comment on this one.

Arnaud


Version - Raymond Del Tondo - 03-15-2005

That's normal, because the word VERSION will be treated as

an unevaluated expression, or just a name;-)

Raymond


Re: Identifying calc type in RPL - V-PN - 03-15-2005

This is an untested program for all RPL models

<< IF ? TYPE 6. # THEN "49G"
ELSE IF ! TYPE 6. # THEN "48"
NOVAL TYPE 6. # "G" "S" ITE +
ELSE "28" PATH TYPE 6. # "S"
"C" ITE + END END >>

Could you all kindly test it, please?
[VPN]




Re: Identifying calc type in RPL - sjthomas - 03-15-2005

> The 'S' type calcs don't have the VERSION keyword.
> On the S types, there exists a suitable SYSEVAL address,
> which I don't recall right now.

I *think* its #Ah SYSEVAL


NO-VAL on the S - Raymond Del Tondo - 03-15-2005

I haven't tested your program (did you?),

but the 48S series doesn't have the self-referencing keyword NOVAL,

so it can't be created or used on the 48S.

The 28C doesn't have the keyword PATH,

so same effect as above (not usable;-)...

BTW: A test for the HP-28 C/S is somewhat pathetic, isn't it?

Raymond

Edited: 15 Mar 2005, 8:59 p.m.


Re: NO-VAL on the S - V-PN - 03-16-2005

BUT the whole point is that there is *no* such keyword!

[VPN]


Re: NO-VAL on the S - Raymond Del Tondo - 03-16-2005

?

Hope I didn't get you wrong,

but the point is that you can't even key in

the program on an HP-48S, nor on an HP-28.

Raymond


Re: Identifying calc type in RPL - Les Bell - 03-16-2005

I tried keying it into a 48GX, out of curiosity, but get a syntax error on the first THEN. . .

Best,

--- Les

[http://www.lesbell.com.au]


Re: NO-VAL on the S - V-PN - 03-17-2005

Darn!

but you've got the idea and can probably make a simple UserRPL program that will give you the answer

[VPN]

PS: I should have all those calcs for testing....


Re: Identifying calc type in RPL - V-PN - 03-17-2005

This is a partially tested 
(28S, 48gII, 49G, 49g+)
program for all RPL machines

<<
IF ? TYPE 6 ==
THEN
IF GROB 1 1 11 TYPE 11 ==
THEN "48" NOVAL TYPE 6 ==
"S/SX" "G/G+/GX" ITE +
ELSE 3 DROPN "28" "SC" PATH
TYPE 6 == 1 + DUP SUB +
END
ELSE "49-Series"
END
>>
BYTES # 2B92h 183. "49-Series"
Could you all kindly test it again, please?
[VPN]