Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!xylogics!bu.edu!snorkelwacker.mit.edu!ai-lab!rice-chex!bson From: bson@rice-chex.ai.mit.edu (Jan Brittenson) Newsgroups: comp.sys.handhelds Subject: Re: Some HP-48 Internals Answers Message-ID: <13652@life.ai.mit.edu> Date: 4 Mar 91 05:44:18 GMT References: <13605@life.ai.mit.edu> <27d099e0:2282.1comp.sys.handhelds;1@hpcvbbs.UUCP> Sender: news@ai.mit.edu Organization: nil Lines: 61 In a posting of [3 Mar 91 06:40:04 GMT] akcs.dnickel@hpcvbbs.UUCP (Derek S. Nickel) writes: > The value 028FC is a "prolog signature", not an address of some code. > Try unassembling (not unthreading) at, for example, 02911 and you will > see that the fist two instructions (D=D-1 and some HST stuff) are > unusual", if fact the HST stuff is a NOP. But those first five > nibbles are used by other parts of the OS to identify a prolog object. This is what it looks like: 028fc Type: 028fc 31a0 move.p2 #a, c 02900 b6a sub.b c, a 02903 808c jump.a @a 02907 82c20 data.a span10nib ; ; #2c28 0290c e8030 data.a L_0308e 02911 type_Short: 02911 cf820 TYPE 02916 487 brcs L_0298f 02919 1c4 sub.a 5, d1 0291c 141 move.a a, @d1 0291f 142 move.a @d0, a 02922 164 add.a 5, d0 02925 808c jump.a @a 02929 94c20 data.a span21nib ; ; #2c49 0292e f7030 data.a L_0307f 02933 type_Real: 02933 cf820 TYPE 02938 465 brcs L_0298f 0293b 1c4 sub.a 5, d1 0293e 141 move.a a, @d1 02941 142 move.a @d0, a 02944 164 add.a 5, d0 02947 808c jump.a @a Where is the "D=D-1 and some HST stuff"? (D=D-1 f = DEC.f D; "f" is the field) The prefix at #2911 is #28fc. If A contains #2911, then the threading instruction "JUMP.A @A" will jump to #28fc. At #28fc, 10 (decimal) will get subtracted from A, after which it will contain #2911-10 = #2907. The "JUMP.A @A" then jumps indirect #2907, which is #2c28, where a spanning routine for 10-nybble objects resides. D0 (which points to wherever the #2911 was found, i.e. where the object is) is advanced by 10 past the 10-nybble object. Similarly, the ML code at #2c48 advances D0 by 21, which is the size of a real. > Is this clear (I fear its not). My point is that 028FC is not an > address but actual machine code. (unassembling at address 028FC only > leads to madness - trust me - I tried it before I realized what was > going on). - Mr. Spock, any madness readings? - No Sir. Just plain logic. -- Jan Brittenson bson@ai.mit.edu Read my lisp: no new classes!