4K HP 67 Games rom attached for testing
|
10-28-2016, 01:28 PM
Post: #21
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Dieter,
Your game of 26 is great and does not take much space Consider it included! Now to strip out the game of 36 and get a version of it running. We will then have non-card reader requiring versions of all the programs for the 4K rom and it will be ready for Angel to work his magic. :-) |
|||
10-28-2016, 02:22 PM
Post: #22
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-28-2016 01:28 PM)Gene Wrote: We will then have non-card reader requiring versions of all the programs for the 4K rom and it will be ready for Angel to work his magic. :-) Can't wait ;-) "To live or die by your own sword one must first learn to wield it aptly." |
|||
10-28-2016, 03:50 PM
Post: #23
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
New game to be put into the 67 games rom! Angel, don't redo the rom yet. I'll send all the .raw files when it is good to go. :-)
The game is "11/30" - 142 bytes. Raw file attached. Similar to this old HP 65 ! game: HP-65 11/30 write-up XEQ 1130. Enter decimal seed and then enter an initial bank deposit. HP will generate two random numbers between 11 and 30. Display will show 12.25 BET? You enter a $$ amount to bet that the NEXT random number between 11 and 30 will actually fall between the two displayed values, end points inclusive. So key 10 R/S to bet $10. You win if the next number is 12, 13, 14...24, 25. You lose if it is 11, 26, 27...30. Press R/S to try again. When the 41C has shown the win or lose display, press E to display current bank roll. Press A to start over with two new numbers. Hope to get this into the 4K rom. 1130 raw file Example: XEQ alpha 1130 alpha SEED? 0.123456789 R/S POT? 50 R/S 12.14 BET? (Gene: Not very likely next number is between 12-14!) 0 R/S (Gene: Bet $0) LOSE 28-12.14 (I lost $0 because the next number was 28 - outside range of 12-14). R/S 14.22 BET? 20 R/S WIN 21-14.22 R/S 17.24 BET? 5 R/S WIN 18-17.24 E (Gene: Check bank) POT =$75 A (Gene: Start new set of numbers) 25.28 BET? 0 R/S LOSE - 15-25.28 and so on. Note: I'm not worried about the language of "losing" $0. That's a win in reality, but I didn't want to make this game any longer than it is. Enjoy. |
|||
10-28-2016, 05:59 PM
(This post was last modified: 10-28-2016 07:59 PM by Dieter.)
Post: #24
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-28-2016 01:28 PM)Gene Wrote: Your game of 26 is great and does not take much space Consider it included! Thank you, but wait for the combined 26/36 program. It's nearly finished and only requires some testing. Edit: here it is. Try it and see if you find any errors or other things you would like to have changed. Major parts of the code have been rewritten, e.g. to make sure it does not stop with pending subroutine calls. Also the random number generator has been improved. The program uses R00...05, so SIZE 006 is sufficient. Wins and losses of both games, "26" and "36", sum up in one common bank total. I made the game of "36" a bit more challenging in that the user now has to stop his sequence exactly in the second the summed score is displayed, i.e. you have just one second to decide whether to continue or not (by pressing the "0" or "." key). ;-) Here is a sample session: Code: XEQ "G2636" SEED? Any errors or suggestions? Dieter |
|||
10-28-2016, 08:42 PM
Post: #25
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing | |||
10-28-2016, 09:00 PM
Post: #26
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Thanks - forgot about the CF29. :-)
On the game of 36, how about having the program display HP: XX You:YY as either the player or the HP is rolling ? My version of "36" does that and it makes it more fun to play, IMO. I don't think it will take that much extra space. It looks very good! I'm hoping we can squeeze all of these into a 4K space. I hope to get a 4K done and then if we can find enough good material not already present in existing 41 series games and if there is enough interest here :-) perhaps a second 4K image. I'd rather do that than wait to get an 8K put together. |
|||
10-28-2016, 09:48 PM
(This post was last modified: 10-28-2016 09:49 PM by Dieter.)
Post: #27
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-28-2016 09:00 PM)Gene Wrote: On the game of 36, how about having the program display HP: XX You:YY as either the player or the HP is rolling ? My version of "36" does that and it makes it more fun to play, IMO. I don't think it will take that much extra space. It looks very good! No problem – 335 vs. 309 bytes. Here it is. Dieter |
|||
10-29-2016, 06:37 PM
Post: #28
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Ok, so here are the 14 files that are candidates for the 4K HP 67 games rom. The .zip file linked to below contains the .raw files for the programs.
Angel - don't take these just yet :-) 4K HP67 games rom .raw files Games include: 1130 FollowMe 26/36 Golf Battleship ChuckaLuck Artillery Chess JiveTurkey Lander One Arm Bandit SpaceWar Star Trek TicTacToe Of those, I think Golf and Artillery could use some extra review. If my math is correct, these take 3778 bytes as shown (I shortened a few global labels). That leaves about **278** free bytes to either use to drop another game in or to make some of these games a bit more friendly. I am hoping to get this sent off to Angel very soon. He is a very patient guy especially with me! thoughts ? |
|||
10-30-2016, 02:11 AM
Post: #29
|
|||
|
|||
HP-67 AOS program to debug
This is an AOS (algebraic operating system) program for the HP 41 from an original written by Jim Horn (Hi Jim!) found on my website here:
http://rskey.org/gene/calcmuseum/67aos.htm with a link to the original PPC Journal program listing here: HP-67 AOS I wonder if my use of flag 2 rather than 22 has messed this up for number entry (possibly) or something else I have not quite done right. I don't understand the last two steps either. here's the .raw file. AOS .raw file here's the text listing: Code: 01 LBL "AOS" If we can get this working and if it will fit, I'd like to include it in the HP 67 4K rom file. Help! |
|||
10-30-2016, 03:29 PM
Post: #30
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-29-2016 06:37 PM)Gene Wrote: Ok, so here are the 14 files that are candidates for the 4K HP 67 games rom. The .zip file linked to below contains the .raw files for the programs. There is a new version of the 26/36 game. Version G2636z now is down to 308 bytes as some duplicate steps in the "36" program could be saved and a bit of optimizing was done. I also did a slight change of the calculator's strategy in that it now risks another roll if the score is up to and including 33 (before: 32). After all at this point there is a 50:50 chance to succeed. ;-) Dieter |
|||
10-30-2016, 03:52 PM
(This post was last modified: 10-30-2016 08:45 PM by Dieter.)
Post: #31
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-30-2016 02:11 AM)Gene Wrote: I wonder if my use of flag 2 rather than 22 has messed this up for number entry (possibly) or something else I have not quite done right. I haven't checked your listing but the 67/97's data entry flag 3 is equivalent with the 41's flag 22. So SF 3, CF 3 and F? 3 become SF 22, CF 22 and FS?C 22. BTW, this sequence... Code: 171 RCL 23 ...will not work either. This adds 10 or 0. The original program adds EEX 0 = 1 (!) if flag 2 is set (or 0 otherwise). On the 41 you could do it this way: Code: 171 RCL 23 And there are more errors. For instance steps 047...050 are duplicating the ones before and have to be removed, or a GTO B turned into GTO b. Addendum: (10-30-2016 02:11 AM)Gene Wrote: I don't understand the last two steps either. Maybe I got the idea behind this. The (second) label B at line 217 of the original program seems to be the common endpoint where the result is displayed. The instructions say that here a [R/S] will re-enter a value calculated by a function that was not part of the program, e.g. sqrt or log. This [R/S] will then set flag 3 and quit (c.f. the last two instructions) so that subsequent operations accept the result as a new entry. I now have a corrected version for the '41 but it still does not work quite right. So there's still something left to do. And I'm sure the 41 version can get shorter than the original as storage arithmetics is available for R23 and R24, and because not just R25 can be used for indirect addressing. Dieter |
|||
10-30-2016, 09:41 PM
(This post was last modified: 10-30-2016 09:58 PM by Dieter.)
Post: #32
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-30-2016 02:11 AM)Gene Wrote: This is an AOS (algebraic operating system) program for the HP 41 from an original written by Jim Horn (Hi Jim!) found on my website here: Here is a first version that seems to work. Try 1+2x3^4 and get 163. I replaced two duplicate labels A and B, otherwise the program is essentially unchanged. And that's why this definitely will not be the final version. There is a lot that can be done more efficiently. But now try this first attempt and see if it works. Dieter |
|||
10-30-2016, 09:51 PM
Post: #33
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Thanks, sorry but I was traveling today. I quickly typed in the program as best I could last night and wanted to get it posted here. I will look it over. I have also invited the original author, Jim Horn, to come take a look here. :-)
|
|||
10-30-2016, 11:33 PM
Post: #34
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Wow, Gene, you were able to translate the code from the original Neanterthal...
The '67/97 AOS program was an early attempt to squeeze a flowcharted algorithm for algebraic entry parsing from a Fortran class I took in the spring of 1972, just to see if I could do it. The same issue includes an article describing it. And a later one should have a correction as the textbook I got the flowchart from was in error which I dutifully embodied in the code. Sigh - some things don't change. The program was terribly useless as it was really, terribly slow. Of course, a '41CL would be lightning fast, eliminating that problem. As mentioned by others, the '67/97 flag functions differed compared to the '41 so that needs to be dealt with. Some of the oddities (why EEX 1 instead of 10, etc.) were due to tricks in the '67's timing. They were done as they were faster, not more readable(!). Since the '67 had a fixed number of registers, I put the index registers at the (known) top worked a stack down from there. The '41's reconfigurable memory would allow a stack to work up with the SIZE value being the only limit. As I recall, each function was encoded into a function stack as a two digit number. The INT(value/10) was the function value (each function had a distinct value to allow branching later); the units digit was a priority level - the higher the value, the higher priority which took precedence over the lower values. Thus addition would be held until multiplication was done, etc. If I recall, the book/flowchart/algorithm/'67 program bug was that once a higher priority operation could be done, it was popped from the stack and evaluation continued. Instead, it should have looked to see if the next item down the stack was due for evaluation and, if so, do so until either the stack was empty or priorities indicated otherwise. The later version corrected this. Dedicating an entire register to hold an operator stack value is terribly inefficient but that's all I was able to squeeze into 224 steps. A '41 ROM that has more room for code could consider doing binary packing a whole lot more efficiency. But then again, who needs hundreds of levels of parentheses? Even the most enthusiastic AOS fan would pale at the prospect! Ah, the days of spending hours and hours to save a millisecond or byte. It wasn't practical but was terrific mental exercise! Best wishes to all who wish to dig into such paleosoftware! Since my rather modified '67 went to a good home decades ago, I have nothing to run this on. Will have to check out the various simulations out there. |
|||
10-31-2016, 02:00 AM
Post: #35
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Not me. Dieter is the coding expert here.
Never did see a NOP in the PPJCJ anyplace. |
|||
10-31-2016, 07:36 AM
Post: #36
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-30-2016 11:33 PM)Jim Horn Wrote: The program was terribly useless as it was really, terribly slow. Of course, a '41CL would be lightning fast, eliminating that problem. A standard '41 already runs 3x as fast as the 67/97, and there are several things that can be done shorter and faster. But still... (10-30-2016 11:33 PM)Jim Horn Wrote: Some of the oddities (why EEX 1 instead of 10, etc.) were due to tricks in the '67's timing. They were done as they were faster, not more readable(!). I wonder if 1/10 s or less makes a difference when a routine runs for about 10 seconds. But you can also find "E" instead of "1" in some HP41 programs. #-) (10-30-2016 11:33 PM)Jim Horn Wrote: Since the '67 had a fixed number of registers, I put the index registers at the (known) top worked a stack down from there. The '41's reconfigurable memory would allow a stack to work up with the SIZE value being the only limit. Yes, that's an obvious choice which I have been thinking about. But this requires a better understanding of the program. ;-) (10-30-2016 11:33 PM)Jim Horn Wrote: As I recall, each function was encoded into a function stack as a two digit number. The INT(value/10) was the function value (each function had a distinct value to allow branching later); the units digit was a priority level - the higher the value, the higher priority which took precedence over the lower values. Ah, good, that's how I thought it would work. This priority check is done in step 064...064. The lowest level is 0, assigned to the "(" function. (10-30-2016 11:33 PM)Jim Horn Wrote: Dedicating an entire register to hold an operator stack value is terribly inefficient but that's all I was able to squeeze into 224 steps. A '41 ROM that has more room for code could consider doing binary packing a whole lot more efficiency. I think this would get way too slow. (10-30-2016 11:33 PM)Jim Horn Wrote: Ah, the days of spending hours and hours to save a millisecond or byte. It wasn't practical but was terrific mental exercise! Best wishes to all who wish to dig into such paleosoftware! Since my rather modified '67 went to a good home decades ago, I have nothing to run this on. Will have to check out the various simulations out there. A really good one was recently developed in this forum by "Panamatic". But now let me ask a few questions about your program: As already posted, I think that the (second) label B near the end of the program is the point where all routines stop and the result is displayed. Pressing [R/S] at this point will set flag 3 and thus simulate a new data entry, as mentioned in the instructions. Is this correct? As far as I can tell the CHS function requires this additional [R/S]. A simple [f][c] after a calculation does not change the sign of the result. At least it does not in my translated '41 program, only another [f][c] does it. Is this the intended behaviour? BTW, why did you use label A and B twice? There are other unused labels available, e.g. 8 and 9. Finally, could you say something about the use of flags 1 and 2? What are they used for? Dieter |
|||
10-31-2016, 04:19 PM
Post: #37
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
As of now, we are at 4094 bytes for this 4K rom. To cover the overhead of the FAT, etc., we need to be down to around 4050 or so. We need to trim about 45 bytes.
I was thinking of changing the labels to 2-3 characters. TTT probably needs to stay TTT, but SPW67 could go to SPW (saves two bytes) and ST67 could be ST (2 more), etc. These are the games / programs targeted to be included in the first 4K rom. G2636 1130 CH41c GOLF F67 CHK BSP SPW67 ST67 ART OAB JT TTT ML AOS |
|||
10-31-2016, 05:08 PM
Post: #38
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(10-31-2016 07:36 AM)Dieter Wrote: But now let me ask a few questions about your program: Hello, Dieter! An honor to have you looking at my old program. I'll dig into it and try to remember exactly what's going on with it, flags and all. Will try to answer you questions later tonight (tomorrow in Europe). Best to you! |
|||
10-31-2016, 05:51 PM
Post: #39
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
A few findings for the '67 version: Flag 1 marks an implied multiplication. If an open parenthesis isn't preceded with an operator, a multiplication is assumed. So "5(3+7)" or "(1+2)(3^5)" will both work.
Flag 2 is to prevent a operand stack drop after negation (i.e. a unary operator only takes one operand, not two, so the operand stack doesn't get smaller). The LBL 0 before the SF 2 (original line 204) was if other unary operators needed that but was never used - no room for square root, inversion, etc. The arcsine and square roots are to throw errors if a stack tries to shrink below having no entries. Crude but they work. When this was written, there was a sometimes heated exchange going about the relative merits of RPN versus inferior (oops, excuse me) alternative entry systems. In coding the textbook algorithm, I decided to add implicit multiplication, automatic parenthesis closure and such to make the resulting system as efficient as possible. That RPN was still significantly more efficient still was not surprising. I'm still so used to it that alternatives are painful for me to use (though Mathematica is pretty nifty!). |
|||
10-31-2016, 07:04 PM
Post: #40
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Ok, here are the candidates for inclusion in the first HP-67 4K games rom for the HP-41.
Link to zip of .raw files - 15 of them If my math is correct, these add up to 4047 bytes, which is SEVEN bytes shorter than we have to have! Woohoo. Lol. If Dieter manages to shrink the AOS program even a little bit, I will go back and give all the programs 3 letter program labels. Please look these .raw files over. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 10 Guest(s)