Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!helios!tamuts!n233dk From: n233dk@tamuts.tamu.edu (Rick Grevelle) Newsgroups: comp.sys.handhelds Subject: Re: Machine code on the HP48 Message-ID: <7979@helios.TAMU.EDU> Date: 5 Sep 90 12:46:49 GMT References: Sender: usenet@helios.TAMU.EDU Distribution: comp Organization: Texas A&M University Lines: 58 The ->SYS routine is obsolete. It requires the code to be typed in backwards and in increments of sixteen. Eventhough I still use some of the SYSEVALs in ->SYS to "bootstrap" machine routines into programs, since the STRING->CODE routine has been written there is little reason to use it. STRING->CODE takes a string of hex code as its argument and returns a Code object. There is no need to mess with calculating the length and replacing the prolog as this is all done by the routine. For example, the machine routine CHT can be converted from string to Code simply by placing the string of hex code for that routine on the stack. 1: "143132169146132174E7143132144132142164808C" Here is the routine that will create the STRING->CODE conversion program. CS->C [7B4] /<< /<< "" + A />> 4 # 01DD641001231341h # C4616316D241461Ah # 731602F918631AD2h # 1775A802A2C43901h # 1810C1CD3317145Ch # 30131DEE94113A41h # 1476E90913504A6Bh # E90513A6B0196015h # 5DC0151A0AA03336h # C434C1541704C1BAh # 14133111154102DCh # 1CD2113311110096h # C80846124123101h 1 12 START # 5193h SYSEVAL NEXT # 2DCCh # 5A03h SYSEVAL # 5ACCh SYSEVAL # 1D524h SYSEVAL # 54AFh SYSEVAL # 5445h SYSEVAL />> It should also be noted that the CHT routine is obsolete. The above program uses two SYSEVALs which perform the same task. Here is the SYSEVAL equivalent. CHT /<< # 5A03h SYSEVAL # 5ACCh SYSEVAL />> If there are any questions about the applications of these programs, please ask. Rick Grevelle