Path: utzoo!attcan!uunet!snorkelwacker!ai-lab!rice-chex!bson From: bson@rice-chex.ai.mit.edu (Jan Brittenson) Newsgroups: comp.sys.handhelds Subject: Re: (long) Re: SAD - Saturn Disassembler Beta 1.01 Message-ID: <10772@life.ai.mit.edu> Date: 17 Sep 90 22:48:29 GMT References: <57448@microsoft.UUCP> <10753@life.ai.mit.edu> <57461@microsoft.UUCP> Sender: news@ai.mit.edu Organization: nil Lines: 123 In article <57461@microsoft.UUCP> alonzo@microsoft.UUCP (Alonzo GARIEPY) writes: > Since my program is reversible, the listing files are completely > compatible with input files (code for assembly, hex for disassembly). OK, I have added a command-line option for eliminating all address and opcode info. At the start of the disassembly an "org" pseudo-instruction is printed. Symbols can, with another option, be moved from the instrcution field to the comment field. Also, I added an option for "full XREF," at which the disassembler keeps track of all references to a symbol, and prints them out at the end. (As comments.) The auto-definition of known-and-referenced-but-not-defined symbols can be removed with a command-line option. This is the same stralloc: org #5b79 ; Allocate string on heap. ; C is to contain the string length, in bytes. ; Sets r0 to object header address, and d0 to data address. ; Sets mode to hex. stralloc: sethex add.a c, c ; Bytes to nibbles clrb #a, st ; No GC performed move.1 4, p add.a p+1, c move.w c, r0 move.1 0, p call.a #6806 ; ["c=free_mem"] move.a c, a move.w r0, c move.1 15, p add.a p+1, c move.1 0, p brle.a c, a, #5bad ; [stralloc+#34] call.a #1633d ; GC? jump.3 #5b88 ; [stralloc+#f] move.w r0, c move.1 4, p add.a p+1, c move.1 0, p call.a #6ad8 ; blkalloc? swap.a a, d0 move.a a, d0 swap.w a, r0 move.p5 #2a2c, c ; [type_String] [etc] type_String=#2a2c "c=free_mem"=#6806 ; [type_String: #5bc7] ; ["c=free_mem": #5b8a] ; [stralloc: #5b9d #5ba9] > Certainly, the # is optional for numbers less than 10, but you > wouldn't leave it off of something you *know* is hex like machine > code. OK, what I'll do is add another command-line option, '-z', for "Alonzo mode" :-) which will format things like you'd like 'em. Would you like a colon following the address? I can remove the "org" pseudo instruction as well, although I think it's something every assembler should accept or ignore. > How about a second semicolon? code ; hmm? ; #f00 code ; ; #f00 A second semicolon you will have. > I have never been big on the use of comments for machine readable > info, Well, the info wouldn't be machine readable. The (possibly nested) brackets would only identify discardable junk. A second semicolon (as long as there's at least one character following the first one) certainly fills the same purpose. > Generally, you can figure out whether the location after an > unconditional jump is code by what refers to it before or after that > point. Unless "what" is data... Things like jump tables really don't fit into this either. As I see it, there is really no way to (easily and quickly) tell, except for the person doing the disassembly, using the disassembler as a tool. >> How about: >> Subexpression (substring), can contain >> any characters including new lines. Clarification: of\tcharacters> >> [RPL] > Actually, this is well understood. I have added the basics to my > disassembler. Someone mail me a description of how RPL objects are stored, and I'll include support for it in the disassembler. A specification of desired print formats would help, too. I will take your HP-48 SYSEVAL list for RPL functions and stick it into an initial Symbols file (so it is distributed along with the disassembler). I will do the same with Grevelle's "SYSEVALed keys" as posted on Aug 26th. I.e. definitions like: alpha_orange__shift=#3aa37