Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!tamuts!n233dk From: n233dk@tamuts.tamu.edu (Rick Grevelle) Newsgroups: comp.sys.handhelds Subject: Re: RPL constructs Message-ID: <9250@helios.TAMU.EDU> Date: 18 Oct 90 07:53:14 GMT References: <11408@life.ai.mit.edu> <9206@helios.TAMU.EDU> <11423@life.ai.mit.edu> Sender: usenet@helios.TAMU.EDU Organization: Texas A&M University Lines: 104 In article <11423@life.ai.mit.edu> bson@rice-chex.ai.mit.edu (Jan Brittenson) writes: > Perhaps I should have been more precise: this may dumbfound you, > but all I want to know is how they are stored. I remember someone > mentioning a while ago that there is more to how an IF clause is > stored than just the keywords (RPL addresses of IF, THEN, etc). I have > also noticed there are several more branch (switch on types, for > instance) instructions used internally. Jan, it was me to whom you refer. I now know what it is you're asking, but this should be an easy task for you. The difficult task is deciphering the numerous machine routines used internally by RPL to handle these structures. The relatively few prefixed machine routines used to support keywords such as these are just the tip of the iceberg as far as the internal world of RPL is concerned. Further, many of these are multifacited in that they will perform differently depending on what conditions exist at the time of execution. Take for example the prefixed machine routine responsible for both keywords START and DO. The routine's address is #71A2h. Here is an example of how this routine works. Used as START 02D9D begin RPL 23754 list_{ 'noname 'stop } (these are local variables used to store the start and end of loop) 074D0 store_local_variables 071A2 start ..... ..... (loop clause) 2326A next 0312B end RPL Used as DO 02D9D begin RPL 071A2 do ..... ..... 071C8 end? (requires boolean #3A81h, true; or #3AC0h, false) Here are some other clause addresses I've currently documented in the 48: 073C3 start 0 to n-1 1short 073C3 start 1 to n-1 1short 073DB start 1 to n-1 1short 073F7 start n2 to n1 1short2short 07221 current loop increment 07249 n of loop 07334 next 073A5 step If you're interested in how these routines manipulate data, do what I did and disassemble them. If it's the keyword structures such as DO UNTIL END, START NEXT, or IF THEN ELSE in which you're interested, store them in the top of the RAM and PEEK at what is there. The manner in which these are stored is fairly straight foward; there is some nesting which occurs, but it shouldn't be any sort of a problem for you. If you should have any specific questions about you findings, post them here or send via . > Is the exponent stored as an 8-bit integer (i.e. 0-255), or as two > digits (00-99)? It would make sense to me if also bits of the exponent > sign nibble were used, since the exponent range is -499 to 500. > Perhaps it's three digits (000-999), with a xsn digit of '5' or higher > denoting negation? What about the mantissa sign - are mantissa signs > of 0-4 considered positive while 5-9 are considered negative? You are quite right, I stand corrected. The exponent for a real is stored as twelve bits. The quick and dirty way to determine what negative exponents will look like when stored internally is to add the negative exponent to a thousand. For example, to determine what 1.23E-456 would look like internally, add -456 to 1000. The negative exponent would be stored as 544. Here is how the real looks internally. 012300000000054402933 As far as the sign field of the mantissa is concerned, it remains as previously described; a zero for a positive and nine for negative mantissas. Also note that the mantissa utilizes only decimal numerals, hex characters A-F never appear. > If this is a problem, I can volunteer to set up a mailing list to > which I only add people after they submit me a message stating their > 48's serial number, and its place and date of purchase. I'll be more > careful with posting things like this to the net. > Does HP even care? If nothing else, it's probably just good for > their sales and image. The mailing list sounds great to me. Does HP care?... I don't know.. I don't think I'd want to find out, at least in a court of law I wouldn't. Now about it being good for their sales image, it wouldn't seem so. Eventhough this news group is read around the world, I'd bet you that were only a very small percent of HP users. For instance, there are 44,000 students enrolled this Fall here at A&M. I've seen 48s all over, especially within the college of engineering, but I personally know of only a couple of individuals who actively read this board. Rick Grevelle