n023el@tamuts.tamu.edu (Robert Ellis) (08/18/90)
I am posting this for Rick Grevelle. ------------------------------------------------------------------------- From: Rick Grevelle <uunet!tamuts.tamu.edu!n242df> Subject: Finding Prefixed Machine Routines In The 48. Some of the more interesting SYSEVALs are those routines which are prefixed with their own address. This is the way in which RPL calls machine code. These routines can in turn call up other machine routines that have no prefix, or they can call to another RPL routine. Disassembling these routines can yield a wealth of information. The group of engineers at HP that wrote them are extraordinaryly skilled. One can acquire a great deal of knowledge about assembler in a relatively short period of time by simply examining the code contained within these programs Unfortunately, finding these routines can be somewhat tricky, as well as slow when using a PEEK program. Furthermore, because no two routines share the same prefix, Alonzo's FIND routine will not facilitate the task either. I've written a routine specifically to find these invaluable SYSEVALs. With the intentions of keeping the routine short, I've made no allowances for error checking. Level 1 MUST CONTAIN A BINARY INTEGER! This lets the routine know where to start looking. The RESULT address is one plus the actual address of the SYSEVAL, so that in order to resume searching, just reactivate the program. CMACF will create a Code object that is the MACF (machine find) program. By storing this in a variable, the search process can be easily automated by outputting the data to a PC or infrared printer. I'll include an example. From # 0h to # 6FFFFh I've found 1,497 of these routines. Many of which are quite recognizable from my 28 ROM map. But there are many more that are new and unexplored. The reason for posting this program is so that others too might generate this massive list and begin exploring the 48's ROM. Lately there has been quite a bit of complaining about the inability to program the ALPHA_key. If a SYSEVAL exist for the ALPHA_key, it will more than likely be amoung these addresses. CMACF [4152] \<< # 3174197160731741h # 181314E331741607h # 4173170EC6A830F8h # C808461241173705h 1 3 START # 5193h SYSEVAL NEXT #2DCCh # 5A03h SYSEVAL # 5ACCh SYSEVAL \>> Remember that each address generated by MACF is one higher than the actual SYSEVAL address. If you don't read Saturn Assembler, and you are going to test these by SYSEVALing, back up your calculator's memory, as you're going suffer repeated memory losses. This is absolutely guaranteed! Here is a program which will generate all 1,497 addresses by outputting to an HP infrared printer, providing there is one availble. To use this program store the Code object generate by CMACF in a variable MACF. By placing # 0h on the stack, GLIST will test all of the address space of the address space between # 0h and # 6D37Dh; the last routine before # 6FFFFh. GLIST [2072] \<< WHILE DUP # 6D37Ch < REPEAT MACF 1 - PRT1 1 + END \>> Time permitting, I shall try to answer any questions. Rick Grevelle