The Museum of HP Calculators

HP Forum Archive 09

[ Return to Index | Top of Index ]

Mt Everest on your 41
Message #1 Posted by Glen Kilpatrick on 7 Oct 2002, 11:36 a.m.

I got to meet Christof(Davis, CA) & db(martinez,california) last night near Borders Books in Davis, an interesting meeting ("Geeks, Unite! You have nothing to fear but low batteries", and for me, low-light levels on LCDs :). Nobody had a belt loop, but we all had toys and stories.

However, I'm posting one of many interesting questions raised, this one for the 41 affectionados (I'm a 48 fan, RPL rather than key-stroke programming). I remember many years ago reading (I think it was) about synthetic programming, and the author was claiming that the Great Unreached Challenge (like Mt. Everest for mountaineers, I was imagining) in the 41 series was making the goose fly backwards.

As its normal course is left-to-right and pointing right, I don't remember if the quest was for the goose to continue to point right, but fly right-to-left backwards, or to turn around and fly forwards, right-to-left; possibly these are two entirely separate challenges. Also, the layout of LCD elements may make it impossible for the goose to point to the left, and thus the second of these two would be physically unreachable nonsense.

Can anyone advise, was this challenge (or these challenges, as appropriate) ever surmounted? And of course, the solution(s) posted to http://www.hpmuseum.org/software/soft41.htm would allow others to marvel.

      
Re: Mt Everest on your 41 - Not a solution, just comments...
Message #2 Posted by Vieira, Luiz C. (Brazil) on 7 Oct 2002, 12:34 p.m.,
in response to message #1 by Glen Kilpatrick

... instead, another question.

I have Synthetic Programming on the HP41, by Bill Wickes, and I did not find it (d... it!), but I remember there is a whole paragraph about it. As I was not that much interested on that particular subject. I remember I read it briefly.

Anyway, I want to ask one question: the flying goose in a backwards flying means the same character flying right-to-left OR a pointed-to-right character flying left-to-right? I hope you do not understand it in the wrong way, because in both cases, the goos IS flying backwadrs. This way, a pointed-to-left goose flying right-to-left is not a flying backwards goos.

I'm enphasizing this because, AFAIK, there is no pointed-to-left goose in the 41's character repertoire (only if it exists in the new halfnut set, not available at the time Synthetic Programming was printed). I just pointed that out to avoid confused attempts to do what seems to be really impossible.

About programming: I'm an RPN/RPL addicted, must admit. The biggest difference, for me, on programming an HP41 or an HP48 is that I completely know (I think I do) all available possibilities in the 41's stack; otherwise, programming an HP48 will lead to vast sort of possibilites, that makes it almost impossible to think of all of them (as many stack levels as you can push into the stack, rotate as many stack contents as you want to, pick any object in the stack WITHOUT loosing the topmost, having morre than one place to store string, storing and manipualting programs in the stack, among others, impossible to be accomplhised in an HP41 OR 42). I use them as I want and have to, given the restrictions for both.

(a sequence of 11 steps with LBL 00 in the HP41 will cause the goose to turn 11 positions forward in a flash, giving the slightly feeling it is flying backwards; I once tried it and laugh with myself: no one else around to foolish with...)

Best regards.

            
RPN/RPL (was Mt Everest on your 41)
Message #3 Posted by Glen Kilpatrick on 7 Oct 2002, 1:43 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Hi Luiz,

I just had to respond to the differences you listed. What you see as disadvantages to that indefinite stack are all advantages to me, but that's not the biggest difference. The most important for me is the way in which one can successively defer execution, and build a program:

* 2 ENTER 3 + (direct execution)

* \RS \Alpha 2 \SPaCe 3 + ENTER (build a command-line)

* \<< 2 3 + \>> ENTER EVAL (on-stack program)

* \<< 2 3 + \>> 'Fred' STO \Fred (save then execute)

For a ~permanent program, of course, there won't be significant difference between a finished (or in-debugging) program in 41-land or 48-, both will be "saved" (whatever that means) and executed, with frequent rewrites.

But many of my programs are one-shot functions, and the flexibility to play on the 48's stack with various levels of deferral is such an enormous advantage. So I suppose I'm highlighting the stack's ability to process many different kinds of objects as much as the uses of the command-line. Whatever, it's all one package called RPL.

                  
Re: RPN/RPL (no disadvantages, just differences)
Message #4 Posted by Vieira, Luiz C. (Brazil) on 7 Oct 2002, 3:09 p.m.,
in response to message #3 by Glen Kilpatrick

Hi, Glen;

I agree with you completely; I also think this way.

Maybe I did not express myself correctly: the four points I mentioned about RPL were done so to show RPN (fixed four-level stack) has restrictions, and knowing about RPL advantages will allow programmers to enhance existing SW.

Best regards.

      
Flying the goose backwards
Message #5 Posted by Massimo Gnerucci (Italy) on 7 Oct 2002, 12:43 p.m.,
in response to message #1 by Glen Kilpatrick

This is the title of the last paragraph (7C) on page 80 of Synthetic Programming on the HP-41C by Dr. W.C. Wickes.

So it seems that - by means of synthetic instructions - this goal was achieved back in 1980.

Greetings,
Massimo

            
Re: Flying the goose backwards
Message #6 Posted by Glen Kilpatrick on 7 Oct 2002, 1:45 p.m.,
in response to message #5 by Massimo Gnerucci (Italy)

Thank you, Massimo. I hadn't known the challenge had fallen so early. I tried a Google search on _"flying the goose backwards"_, no luck, so it's only in the book.

      
this one goes w/o synthetics...
Message #7 Posted by Hans Brueggemann [GER] on 7 Oct 2002, 3:53 p.m.,
in response to message #1 by Glen Kilpatrick

glen, maybe you would like to try the following (spoilers ahead!!) lbl A, 0, lbl 02, sf 25, 1/x, gto 02, end

cheers, hans (porkpiehat@gmx.net).

            
Re: this one goes w/o synthetics...
Message #8 Posted by Andrés C. Rodríguez (Argentina) on 7 Oct 2002, 6:30 p.m.,
in response to message #7 by Hans Brueggemann [GER]

(Just from my memories)

This program:

AVIEW

0

SF 25

1/x

LBL 01

0.010

LBL 00

ISG ST X

GTO 00

X<>Y

X<>Y

GTO 01

will scroll any string in the Alpha register with each label execution, just as the normal goose is used as a running program indicator. The combination of 10 inner loop label executions plus one label in the external loop will cause the string to move "backwards". The deliberate error after Flag 25 exploits a known HP41 bug in which such condition "unfreezes" the display without clearing it, as CLD would have caused.

Now, the issue is how to put a backwards-pointing goose in the display. Actually, such character exists, but it will not appear if there are no other characters in the display, so you will need to also put a period or comma there. In Wickes book, this was referred as "a goose dropping".

                  
oops, wrong movie
Message #9 Posted by Hans Brueggemann [GER] on 8 Oct 2002, 2:41 a.m.,
in response to message #8 by Andrés C. Rodríguez (Argentina)

andrés, the intention of my previous post was just to demonstrate what might happen to someone who is trying to remember hp41c- programs while not even having the calculator at hand, and mixing up the topics. :o(

cheers, hans porkpiehat@gmx.net

                  
Re: this one goes w/o synthetics...
Message #10 Posted by Mike (Stgt) on 8 Oct 2002, 5:28 a.m.,
in response to message #8 by Andrés C. Rodríguez (Argentina)

It's not the Alpha register what rotates, it's the display only (R/S the loop any time and look at Alpha, it is still intact). You may rotate numbers too: PI VIEW X CLX SF 25 1/X LBL 01 SIN GTO 01

To view strange characters you need synthetics: call following before an iterative routine:

CLD

"BS" (hex F7,0B,DB,C8,19,EB,D0,13)

0

X<> d

FIX 10 (hex 9C,0A)

VIEW M

X<> d

RDN

Ciao.....Mike

BTW, use a real HP-41 for that, not all emulators view it correctly :(

      
Re: Mt Everest on your 41
Message #11 Posted by David Smith on 7 Oct 2002, 5:11 p.m.,
in response to message #1 by Glen Kilpatrick

Hurricane Lili made a bunch of ducks and geese fly backwards... there was film at 11:00

      
From the PPCJ, V7N3P3 (Apr 80)
Message #12 Posted by Ernie Malaga on 8 Oct 2002, 2:31 a.m.,
in response to message #1 by Glen Kilpatrick

From the PPC Journal, V7N3P3 (April 1980)

Dear Richard:

A month ago, I felt that there were 3 unsolved challenges remaining for HP-41C synthetic programming pioneers: how to recall the contents of any register without normalizing; how to generate synthetic program lines on a bugless 41C with no card reader; and finally, how to turn the flying goose around and make him fly backwards. The first two problems were solved by the discovery of the "byte jumper" function (which, incidentally, is best understood as the manual equivalent of a program text line). And now, rather to my surprise, the last problem has proved tractable.

The enclosed photograph (I apologize for its quality; all I had available was an oscilloscope camera) is a bit of HP-41C art entitled "Geese Resting on a Fence." You will notice not only multiple geese, but also that one is facing backwards. Thus, programs may be written to show any number of geese facing and flying forwards and backwards, and even flapping their wings if desired. The display shown in the photo is not faked in any way; it was produced on an unaltered HP-41C, using no external devices, no bed-bounding, no dying batteries or modules, etc. Yeah, of course I used the Black Box programs.

Rather than reveal the technique at this time, I will leave it as a challenge to PPC members to produce the display shown in the photo, or one like it. You now have one essential clue that I didn't have: namely that it can be done. Anyone who succeeds can consider himself a charter member of the exclusive "Goose Club" (if you want to be certified, send me a program card that generates the geese). Then in the PPCJ issue following the appearance of this letter, I'll tell all.

Happy Hunting, -William C. Wickes (3735)

Ed Note. Bill's display consists of a 10-character display with a blank on each end. The "birds" are illustrated in the drawing below. The photograph was too small to reproduce well. Sometimes a photocopy works very well to show displays.

!-{-!--}}!

From the PPC Journal, V7N5P56 (June 1980)

Goosing the HP-41C

Congratulations to Egon Jensen (3489) and Charles Close (3878)! These stalwart programmers were the only PPC members to successfully solve the Great Goose Challenge (V7N3P3). It is time now to reveal the solution to this problem, which surely has vexed all serious HP-41C fanciers since the first goose went scrolling around a display. What more could a true calculator fanatic ask than the opportunity to exercise enormous ingenuity and persistence to achieve an impossible goal with no practical use whatsoever? It was alleged at the PPC Midwestern Conference that an unnamed HP engineer once promised a free calculator to anyone who could make the goose fly backwards. I'd like to meet that gentleman...

The problem of taming the goose is twofold: first, does the normal goose character have an associated hex code, and second, if it does, how does one trick the 41C into displaying the goose? That a trick is required is evident to anyone who has used REBLD (V6N8P30) to generate each character associated with the 16*16=256 possible 2 hexadecimal digit bytes. Nary a goose anywhere.

The answer to the first part of the puzzle is so blindingly obvious that I, for one, did not see it until it was thrust under my nose. I was slipped one of the secret HP Diagnostic ROMs one day by one of the shadier characters in the local PPC chapter. The character test routine in the ROM displayed not only a normal forward-facing goose frolicking among the standard characters, but also revealed a never-before-seen backward-facing goose! How could I rest until I had freed these creatures from the oblivion to which they were consigned by their creators? Anyway, a little reflection caused me to compare the displayed character sequence with the hex table (V6N5P23), and lo and behold, the geese were right where they had to be: in the positions 2C (backward) and 2E (forward) apparently already occupied by the "," and the ".". But those two characters, along with the colon ":", are not made from the "boxed star" grid-they come from the interspaced dots. So codes 2C, 2E and 3A are still "available" for boxed star characters, and, in fact, the first two are the nesting places of the geese. The extra 3A character is just another boxed star.

No combination of codes I have yet found will persuade the display ROM to show a goose as an ordinary alpha character; the 2C and 2E always display as "," and "." respectively. One promising idea turned out to be a blind alley: the manual (and the keyboard) forbids us from using any of the three interspace characters as part of an alpha label. But synthetic generation of such labels still only resulted in more displayed commas and periods. Rats.

Finally, while languishing in bed one day with a bout of the flu and hence being even more demented than usual, I dredged up from some muddy corner of my brain the recollection of the curious display status FIX A. This little-known instruction, code 9C0A, has the occasionally useful property of displaying only the mantissa of a number with a positive exponent (without altering the number, of course-it's just a display mode). When playing with this discovery some time ago, I had been mildly annoyed because the mode's utility was compromised since if the number in question had an exponent of 10, 11, 12, or 13 (mod 14), some of the number characters (from row 3 of the hex table) would be replaced by characters from row 2, making the number hard to read.

This "nuisance" turned out to be the key to the goose hunt. I found with a little experimentation that if one places a number with exponent 13 into X, then FIX A (assign it to a key or execute from program), CF 28, CF 29, then the display will show only the mantissa of the number, with the last 9 digits showing row 2 characters. The first digit always remains a row-3 character, which spoils the effect somewhat since there is always an unwanted character flying along with the geese. But the other 9 may be any characters from row 2, including, luckily, the space. So, for example, the display of "Geese Resting on a Fence" given in the original challenge was just the number 1.DCD1DDEE1*10^13 displayed in FIX A. To get a single backwards facing goose followed by a comma (a goose dropping?), try B.C00000000*10^13.

The newly liberated geese will perform a limited number of tricks. To truly make a goose appear to fly backwards (right to left) across the display, one needs only to write a program that successively VIEWs numbers that contain a digit C stepping leftwards among digit zeros (which give spaces in the display). One row 3 character will be fixed in the leftmost position. To make the goose appear to flap its wings, successive displays should alternate digits C and E in the same position. To replace the normal goose with a flock of geese during a running program, place the geese number in X (or any other register). Then at some point of the program with a default display, insert the lines RCL d, VIEW Y, STO d. This will work with any desired display, not just extra flying geese.

The story is not quite complete. The technique described does show both geese, but only with restrictions. In particular, I have not succeeded in enticing the geese into the Alpha register. ARCL X totally ignores the row-2 characters showing in X. And yet, we are enticed by the solitary goose and the goose next to other characters shown in certain of the strange catalogs shown by fooling around with the catalog flag 30. Perhaps the HP-41C still has a few secrets for us to find.

-William C. Wickes (3735)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall