The Museum of HP Calculators

HP Forum Archive 10

[ Return to Index | Top of Index ]

Day-Of-Week (DOW) in the HP48 series - challenge?
Message #1 Posted by Vieira, Luiz C. (Brazil) on 18 Jan 2003, 11:03 p.m.

Hi;

It's time for chalanges, and good challenges are teasing and their result is always helpfull.

I have an HP41CX and this was my first calcualtor with real time capabilities. Later I got an HP48SX, an HP48G+ and now an HP49G. Although the HP12C does not have a real-time clock, it can deal with date arithmetic, as all of the above.

The HP41CX (or its time module functions) has the DOW function, that returns the day-of-week reference for the date coded in the X-register. The HP12C also "shows" the day ofg week when a a date is computed.

Maybe many of you already needed this specific information any of the HP48 calcualtors and it is not available this "easy". The way I found was with the program below, that returns the DOW indicator for any date in Level 1 provided it's coded the same way we do in the HP12C or the HP41CX (or with the Time Module) and according to DMY or MDY set

« 0 TSTR 1 3 SUB »

I store it as 'DOW', and it returns a three letter string ID: "SUN", "MON" and so. The fact is that TSTR (Time STRing) does the trick.

Any other way to accomplish this? I'm not sure this is of any help, but as we do not have DOW directly availlable, it will allow others to focus in the problem and easily have this information without bigger routines.

Best hunting!

Vieira, Luiz C.

      
Re: Day-Of-Week (DOW) in the HP48 series - challenge?
Message #2 Posted by Christoph Giesselink on 20 Jan 2003, 5:42 p.m.,
in response to message #1 by Vieira, Luiz C. (Brazil)

My solution for 'DOW' on the HP48 is the unsupported entry

=DOWSTR EQU #0D2F0

instead of

« 0 TSTR 1 3 SUB »

[30 byte].

=DOWSTR can be used in different ways:

« # D2F0h SYSEVAL »

[33 byte]

or

ASSEMBLE
  NIBASC /HPHP48-E/

=DOWSTR EQU #0D2F0

RPL :: CK1NoBlame CK&DISPATCH1 real DOWSTR ;

[22.5 byte]

or just as RPL pointer in SysRPL code

[2.5 byte]

Christoph

            
Re: Day-Of-Week (DOW) in the HP48 series - challenge?
Message #3 Posted by Vieira, Luiz C. (Brazil) on 20 Jan 2003, 9:16 p.m.,
in response to message #2 by Christoph Giesselink

>>>:-0

Time to learn SYS RPL and 48's M-code... more than never!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall