From: GaaK on
Hello, This program returns for:
48Gii : 0
49G : 1
49G+ : 2
50G : 3

::
CK0NOLASTWD
CODE
* Developed by GaaK
* 48Gii : #0
* 49G : #1
* 49G+ : #2
* 50G : #3
GOSBVL =SAVPTR * Save Pointers
A=0 A * Register used Aa (5 nibbles)
SR=0
BUSCC * $80B
?SR=0 * If 49G?,
GOYES A+1 * then A=1
* * if not, is ARM (48Gii/49G+/50G)
isARM GOSUB 48Gii? * If 48Gii?
GOC A+0 * then A=0
* * if not, is 49G+/50G
GOSUB 50G? * If 50G?
GONC A+2 * if not, is 49G+ (A=2)
* * if yes, is 50G (A=3)
A+3 A=A+1 A
A+2 A=A+1 A
A+1 A=A+1 A
A+0 GOVLNG =PUSH#ALOOP * Push Aa and exit

48Gii? NIBHEX 80BB2 * 48Gii?
RTN * Return

50G? NIBHEX 80BE2 * 50G?
RTN * Return
ENDCODE
UNCOERCE
;

HEX-Data (use H->):
D9D2029262CCD20240008FB9760D082480B8344177104F07710540E4E4E48DC753080BB20180BE2016F262B2130

.... Store it (i.e. 'CheckModel' STO)

UsrRPL example:
« CheckModel
CASE
DUP 0 == THEN DROP "48Gii" END
DUP 1 == THEN DROP "49G" END
DUP 2 == THEN DROP "49G+" END
3 == THEN "50G" END
END »

Other:
« { "48Gii" "49G" "49G+" "50G" } CheckModel 1 + GET »

**********
Fully ML, any ROM.

- GaaK -

From: Raymond Del Tondo on
Hi,

doesn't work on a real HP-48 .
If you include the old 49g (FHB),
you could also include the real HP-48;-)

Additionally, I'd suggest to change the return numbers.
The 49g isn't ARM-based, but the '48Gii' and the others are.
So I'd return zero for a 49g , which would
be much more suitable for that machine;-)))

Raymond


"GaaK" <2006(a)gaak.org> schrieb im Newsbeitrag
news:1167353436.405441.146550(a)s34g2000cwa.googlegroups.com...
Hello, This program returns for:
48Gii : 0
49G : 1
49G+ : 2
50G : 3

::
CK0NOLASTWD
CODE
* Developed by GaaK
* 48Gii : #0
* 49G : #1
* 49G+ : #2
* 50G : #3
GOSBVL =SAVPTR * Save Pointers
A=0 A * Register used Aa (5 nibbles)
SR=0
BUSCC * $80B
?SR=0 * If 49G?,
GOYES A+1 * then A=1
* * if not, is ARM (48Gii/49G+/50G)
isARM GOSUB 48Gii? * If 48Gii?
GOC A+0 * then A=0
* * if not, is 49G+/50G
GOSUB 50G? * If 50G?
GONC A+2 * if not, is 49G+ (A=2)
* * if yes, is 50G (A=3)
A+3 A=A+1 A
A+2 A=A+1 A
A+1 A=A+1 A
A+0 GOVLNG =PUSH#ALOOP * Push Aa and exit

48Gii? NIBHEX 80BB2 * 48Gii?
RTN * Return

50G? NIBHEX 80BE2 * 50G?
RTN * Return
ENDCODE
UNCOERCE
;

HEX-Data (use H->):
D9D2029262CCD20240008FB9760D082480B8344177104F07710540E4E4E48DC753080BB20180BE2016F262B2130

.... Store it (i.e. 'CheckModel' STO)

UsrRPL example:
� CheckModel
CASE
DUP 0 == THEN DROP "48Gii" END
DUP 1 == THEN DROP "49G" END
DUP 2 == THEN DROP "49G+" END
3 == THEN "50G" END
END �

Other:
� { "48Gii" "49G" "49G+" "50G" } CheckModel 1 + GET �

**********
Fully ML, any ROM.

- GaaK -


From: GaaK on
Raymond Del Tondo wrote:
> Hi,
>
> doesn't work on a real HP-48 .
> If you include the old 49g (FHB),
> you could also include the real HP-48;-)

The "binary" objects HP-48 (SX/GX) are not compatibles with binary
objects HP49 (48Gii/49G/49G+/50G), header 'HPHP49-x'.
You can transfer objects between the calculator and a PC and the binary
objects HP48 are not compatibles (in practice).

..... but, this could be made!

> Additionally, I'd suggest to change the return numbers.
> The 49g isn't ARM-based, but the '48Gii' and the others are.
> So I'd return zero for a 49g , which would
> be much more suitable for that machine;-)))

Changing this lines:
?SR=0 * If 49G?,
GOYES A+0 * then A=0 (49G)
* * if not, is ARM (48Gii/49G+/50G)
isARM GOSUB 48Gii? * If 48Gii?
GOC A+1 * then A=1 (48Gii)

.... this returns:
49G : 0
48Gii : 1
49G+ : 2
50G : 3

- GaaK -

From: Veli-Pekka Nousiainen on

"GaaK" <2006(a)gaak.org> wrote in message
news:1167363207.996702.312390(a)k21g2000cwa.googlegroups.com...
> Raymond Del Tondo wrote:
>> Hi,
>>
>> doesn't work on a real HP-48 .
>> If you include the old 49g (FHB),
>> you could also include the real HP-48;-)
>
> The "binary" objects HP-48 (SX/GX) are not compatibles with binary
> objects HP49 (48Gii/49G/49G+/50G), header 'HPHP49-x'.
> You can transfer objects between the calculator and a PC and the binary
> objects HP48 are not compatibles (in practice).

How about a UserRPL version that works from 48S to 50G?
MiniChallange! :-D
Rules: speed * bytes, smallest value wins, eg.
speed using CLEAR MEM DROP @ do a carbage collection
TICKS program TICKS SWAP DROP @ drop the return value
SWAP - B->R 8192. / @ seconds
RCL on stack BYTES SWAP DROP @ drop the CRC
*


From: James M. Prange on
Veli-Pekka Nousiainen wrote:
> "GaaK" <2006(a)gaak.org> wrote in message
> news:1167363207.996702.312390(a)k21g2000cwa.googlegroups.com...
>> Raymond Del Tondo wrote:
>>> Hi,
>>>
>>> doesn't work on a real HP-48 .
>>> If you include the old 49g (FHB),
>>> you could also include the real HP-48;-)
>> The "binary" objects HP-48 (SX/GX) are not compatibles with binary
>> objects HP49 (48Gii/49G/49G+/50G), header 'HPHP49-x'.
>> You can transfer objects between the calculator and a PC and the binary
>> objects HP48 are not compatibles (in practice).
>
> How about a UserRPL version that works from 48S to 50G?
> MiniChallange! :-D
> Rules: speed * bytes, smallest value wins, eg.
> speed using CLEAR MEM DROP @ do a carbage collection
> TICKS program TICKS SWAP DROP @ drop the return value
> SWAP - B->R 8192. / @ seconds
> RCL on stack BYTES SWAP DROP @ drop the CRC
> *

Okay, but perhaps a few things should be defined a little tighter?

UserRPL:

No SYSEVAL, LIBEVAL, or FLASHEVAL?

No commands from 49 series development library (menu 256)?

Models:

48SX and 48S considered to be the same model?

48GX, 48G, and 48G+ considered to be same model?

49G, 48gII, 49g+, and 50g considered to be distinct models?

Returns:

A different number for each model? A string representing the
model number?

Conditions:

Must work regardless of flags settings (except wordsize) and
must restore any modes or flag settings that it changes.

Must work on all 48 and 49 series. For those who don't have all
models available, it can be tested on Emu48 for those models
that aren't available.

On second thought, for the 49 series, should the ROM revision
matter?

Deadline for entries?

Reporting:

Should source code be posted before any deadline?

Results from BYTES, the speed, and the "Speed*Bytes" values for
whichever models are available should be posted.

Prize: Fame?

For the speed test, I suggest first clearing the stack, and
perhaps doing a KILL, forcing the wordsize, and placing the
program itself on level 1, and then running the following program:

%%HP: T(3)F(.); @ ASCII transfer header.
@ Special timer for program that takes no argument and returns one
@ result.
@ First force wordsize 64.
@ The program itself (not its name) should be the only object on
@ the stack.
@ Does not attempt to compensate for the time to do TICKS SWAP.
@ Results from the BYTES command:
@ 48 series:
@ Checksum: # E39Dh
@ Size: 45.5
@ 49 series:
@ Checksum: # 2107h
@ Size: 45.5
\<<
MEM DROP @ Force garbage collection.
TICKS @ Initial system time.
SWAP @ Move program down.
EVAL @ Execute program.
TICKS @ Ending system time.
ROT @ Move initial time down.
- @ Difference.
B\->R @ Convert to real.
8192. / @ Time in seconds.
\<<

--
Regards,
James