+SpiceWare Posted April 8, 2007 Share Posted April 8, 2007 (edited) I'm helping espire8 on a hack and ran Eggomania thru distella using: ./distella -a em.bin > em.asm and got this *: original_em_asm.txt lots of DATA, not much code I started a config file denoting the CODE sections and right away came across a jump table for the PHA PHA RTS trick of jumping to different routines. None of the code jumped to via the table was being disassembled. In reading over the docs for distella I noticed that besides the normal RESET vector, you could also tell it to trace out the BRK vector. I thought it would be useful to add a list of known code starting points to the config table, so I modified the source to include a TRC option to start TRaCing code at a given point. I created a config file like this: ; F283 - F2A7 is a jump table for F2c9 - push (address -1) to stack, then RTS ; TRaCe the JUMP TABLE TRC F4FB; $FA $F4 TRC F536; $35,$F5 TRC F543; $42,$F5 TRC F554; $53,$F5 TRC F543; $42,$F5 TRC F350; $4F,$F3 TRC F543; $42,$F5 TRC F2D6; $D5,$F2 TRC F4EE; $ED,$F4 TRC F39D; $9C,$F3 TRC F424; $23,$F4 TRC F477; $76,$F4 TRC F515; $14,$F5 TRC F2D6; $D5,$F2 TRC F543; $42,$F5 TRC F31E; $1D,$F3 TRC F543; $42,$F5 TRC FFE7; $E6,$FF TRC F000; must add ORG last for some reason... ; GFX FA83 FA89; egg and got the following, which was much more useful *: em_asm.txt This is my modified version of distella.c * distella_c.txt The only issue I ran across was if you use the TRC command then you need to add the ORG ($F000) as the very last TRC command or the wrong ORG will be used. All changes can be found by searching for DGS. I also added a comment token to the config file to supress the "invalid line - ignored" messages. Comments must start with ;<BLANK> as shown in my sample config file above. * NOTE: I renamed all files from filename.ext to filename_ext.txt so I could upload them. Edited November 20, 2008 by SpiceWare Quote Link to comment Share on other sites More sharing options...
supercat Posted October 22, 2007 Share Posted October 22, 2007 Looks useful. A related thing I was thinking of adding would be instructions to inform DISTELLA about the location of jump or RTS tables (in either word or split-byte format). Maybe someday. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted October 22, 2007 Share Posted October 22, 2007 This is my modified version of distella.c * Could you post a DOS/Windows executable of it? Also, am I the only person who uses DIS6502 to disassemble 2600 ROMs? The thing I like about it is that it's interactive. For example, you can highlight a section that disassembled as BYTEs, and flag it as code, and it will change into code. Or you can change a DIS6502-generated label into a more meaningful name, and it will change throughout the code. Or, if you click on a label, DIS6502 will show you everywhere the label is used. Michael Quote Link to comment Share on other sites More sharing options...
+Propane13 Posted October 23, 2007 Share Posted October 23, 2007 Might be time to bundle up Distella 4.0. Were these changes based on 3.0? -John Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted October 27, 2007 Author Share Posted October 27, 2007 Could you post a DOS/Windows executable of it? I'm on a Mac. Were these changes based on 3.0? Yep, the change for this was pretty short too /* added to TRaCe a known code address. */ } else if (!strcmp(cfg_tok,"TRC")) { offset = cfg_beg; addressq=addq(addressq,offset); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.