Day-Of-Week (DOW) in the HP48 series - challenge?



#4

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.


#5

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


#6

>>>:-0

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


Possibly Related Threads...
Thread Author Replies Views Last Post
  An amazing day: Giving a talk at HP about their calculators Geir Isene 9 3,432 12-16-2013, 06:14 PM
Last Post: aurelio
  HHC 2013 Day 2 Highlights Eddie W. Shore 6 1,874 09-23-2013, 04:03 PM
Last Post: Kimberly Thompson
  HHC 2013: Day 1 Highlights Eddie W. Shore 28 5,804 09-23-2013, 03:22 PM
Last Post: Brad Barton
  Flash Flood Warning: 9/16/2013 (One Week from HHC13) Eddie W. Shore 8 2,197 09-17-2013, 09:20 PM
Last Post: Craig Ruff
  HHC 2013: One Week To Go Eddie W. Shore 2 1,134 09-13-2013, 05:32 PM
Last Post: Craig Ruff
  HP to be dropped from Dow Jones industrial average BruceH 21 3,812 09-12-2013, 02:45 PM
Last Post: Chris Tvergard
  Auction Scam of the Week? Frido Bohn 4 1,534 06-03-2013, 01:45 PM
Last Post: Mike Morrow
  Happy Mother's Day! Eddie W. Shore 1 900 05-12-2013, 11:35 AM
Last Post: Walter B
  happy fibonacci day 5/8/13 Allen 8 2,242 05-09-2013, 01:48 AM
Last Post: Gerson W. Barbosa
  Stupid idea of the day: 41-compatible watch bhtooefr 0 771 03-31-2013, 08:23 AM
Last Post: bhtooefr

Forum Jump: