Post Reply 
Raw files for these HP 67 program listings ?
09-07-2016, 01:54 PM (This post was last modified: 09-07-2016 02:09 PM by Dieter.)
Post: #45
RE: Raw files for these HP 67 program listings ?
(09-07-2016 05:16 AM)Ángel Martin Wrote:  Got it, will try to squeeze it in the module but it's looking very full...

Here is a shorter version with some improvements and maybe even a bugfix:

- I think there is a bug in the original program: if there are any holds the user can pull the lever even if there are no no more pulls available. This is tested right *after* checking for holds, while the test should be *before* this. I changed this in the attached version. If this is not the way the program is supposed to work, please correct.

- XEQ b is called only once by the init routine so LBL b can be placed there and requires no separate call.

- R05 (=100) is recalled three times. Replacing this with R04^2 saves two bytes in the init routine and requires three more bytes in the code. At the same time it frees up another register for the cost of just one single byte. This way registers 6...8 move down to 5...7 and SIZE 008 is sufficient.

- The only jump to LBL 03 is done after testing flag 0, so the following CF 00 can be omitted by replacing the flag test with FS?C 00.

- The test for holds can be done more efficiently and faster. The current version tests for a hold on a particular digit, and if true it jumps to a forward label, and finally jumps back to test the next digit. This is slow (especially on the 67 without compiled GTOs) and can be improved. For the third digit even a simple inverse flag test (FC?C) can be used, without any jumps at all. BTW this is also possible on the 67/97, here two consecutive F? 3 are the same as a FC?C 03 on the 41.

- This frees up several labels, so that LBL a can be replaced with the (shorter) LBL 09.

CAT 1 on V41 says we're down to 240 Bytes.
Now it's your turn again, Robert. ;-)

BTW Ángel: what about a text file with the complete listings so far in the new 67 Games ROM? I think there is *much* room for improvement and more effective, byte-saving code.

Dieter

Edit: sorry, forgot the attachment... #-)

.zip  OAB.zip (Size: 1.06 KB / Downloads: 2)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Raw files for these HP 67 program listings ? - Dieter - 09-07-2016 01:54 PM



User(s) browsing this thread: 1 Guest(s)