Path: utzoo!attcan!uunet!lll-winken!ames!eos!shelby!portia.stanford.edu!hobbes From: hobbes@portia.Stanford.EDU (Andrew Zimmerman) Newsgroups: comp.sys.handhelds Subject: Re: Machine code on the 28S (and 48SX) Message-ID: <1990Jun4.222439.21761@portia.Stanford.EDU> Date: 4 Jun 90 22:24:39 GMT References: <55022@microsoft.UUCP> Organization: AIR, Stanford University Lines: 55 A couple of questions of the hp48sx assembly language. My sources for these questions are notes by Alonzo Gariepy for the hp-28s and the recent note about the 48sx. #1 The new document gives XLIB numbers for all of the command. ie for RR, it gives a number of 003002. When I look at the table in 74600, where it appears that there is a table of commands, the table looks more like DB 02 ; number of characters in string DB "RR" ; the string D3 003 ; XLIB# ? DB 02 ; number of characters in next string DB "SL" ; the next string D3 005 ; XLIB# ? (Note: XLIB 4 is skipped, because the table is sorted by the number of characters, and 004 is RRB) So, where do the extra 3 nybbles come from in the document. #2 What is register D1 used for? The documents say that Register D1 points to the end of the stack growing down toward the heap. I interpret this to mean that D1 is the stack pointer. But, in disassembling the code for peek, we have a sequence of instructions that have MOVE.A @D1,A MOVE.A A,D0 ADD.a 10,D0 MOVE.A @D0,C SWAP.A C,D0 MOVE.W @D0,C from this code, I get the impression that D1 is either a pointer to the stack pointer, or the instruction should be MOVE.A D1,A. #3 If I look at the code for ASR at 1957B, I see D9D2.. which appears to be D9 MOVE.A B,C D2 CLR.A C Is this correct? Seems it is clearing reg C after putting something in it. #4 Does anyone know where the processor starts execution? I am guessing that it starts at 00000. (Sorry all you motorola people out there :-)) If I do an EVAL at 00000, it seems that the hp48 comes up in normal mode. But, if you look at the code, there is a jump as the second instruction. This is supposed to be a JUMP.3. Assuming that was the case, I went to the address and did an eval. Didn't seem to work. But, if I assume that it is a 4 nybble address, this address is valid, and the machine come up. Also, If I do an eval right after the JUMP, assuming 4, the machine does come up after doing a memory clear. #5 How was the instruction set determined? Boy, I can't find any fields in it, and those it appears to have move around. Thanks for any help, Andrew zimmer@calvin.Stanford.edu