Path: utzoo!attcan!uunet!microsoft!alonzo From: alonzo@microsoft.UUCP (Alonzo GARIEPY) Newsgroups: comp.sys.handhelds Subject: Re: SAD - Saturn Disassembler Beta 1.01 Message-ID: <57448@microsoft.UUCP> Date: 15 Sep 90 20:43:37 GMT References: <10712@life.ai.mit.edu> Organization: Microsoft Corp., Redmond WA Lines: 72 In article <10712@life.ai.mit.edu> bson@rice-chex.ai.mit.edu (Jan Brittenson) writes: > I have just (sort of) finished a Saturn Disassembler. I would like > a couple of people out there who have previously disassembled parts of > the HP-48SX ROMs to verify that the output is correct by disassembling > previously disassembled areas and comparing the results. > > 05b79 stralloc: > 05b79 04 sethex > [...] Congratulations, this is excellent work. I verified the stralloc routine and everything checks out okay. More tests are definately in order to catch some of the trickier problems. I do have some suggestions to make based on how my assembler/disassembler and Andreas's assembler work. These aren't necessarily the best ways to do things so we should discuss them in order to come to some standard. 1. All hex numbers should be preceded by the # symbol, including the machine code and addresses in listing files. 2. Standard symbols begin with a letter or underscore and contain only numbers, letters and underscores (we can talk about adding such things as the $ and .). 3. Nonstandard symbols are enclosed in quotes and can contain any characters. Example: "Garbage Collector!" When used as labels, the colon goes outside the quotes. 4. All symbols used as arguments should be defined in the disassembly (controllable by command line option). The simplest way to define an address symbol is #xxxxx: symbol: Andreas also supports assignment for address and nonaddress symbols symbol=#xxxxx This has the disadvantage of a potential parsing problem if 'symbol' conflicts with a keyword. One modification is that a standard symbol cannot be a keyword (i.e., if you want the symbol "move" it must always be enclosed in quotes). I imagine we can come up with a scheme where numeric symbols don't conflict with keywords. 5. I have seen many assemblers get into trouble with poor syntax for macro capabilities, so I am inclined to think this through and make it part of the standard. My preference would be to use an existing, portable, macro processor. Cpp is one possibility, but not very attractive. The ideal would be something that is powerful enough to implement the assembler and disassembler itself. Any suggestions out there? 6. Whether arguments are expressed in hex and commented with symbol names, or expressed symbolically and commented with hex equivalents, should be controllable by a command line switch. 7. Comments should not be used for machine readable information. Thus the syntax [<#xxxxx>] should be replaced with the simpler #xxxxx. 8. The data pseudo op is used to put non instructions into the code. Your disassembler should use the data op for anything that is not a valid instruction. Here are a few examples of its use from the CHIP48 source by Andreas Gustafsson... data.b 'A' data.a #2dcc ; machine code object begin: data.a end-begin ; length of object * * * At one point I was planning a better disassembler (like yours!) and I have some interesting ideas about RPL and synchronization (always a problem with disassembly) that you might like to hear. Drop me a line. Alonzo Gariepy alonzo@microsoft