https://github.com/tvrfan/EEC-IV-disassembler
Currently the only thing I haven't worked out how to define correctly is hard coded values aka constants. For an example, this if statement checks if(0 = 0), however it's a flag to enable/disable a feature. I'd like to make it so it's defined as if(Something_Flag = 0) so it's easier to read when looking over the code.
My current solution has been to define a sym for the code line instead of the actual data item which puts the name before the statement like this:1da35: 99,00,00 cmpb R0,0
1da38: d7,03 jne 1da3d if ( true ) {
DIR file
LST outputsym 1da35 "Something_Flag" # Just an example
I've tried several ways of trying to define the byte at 1da36 but haven't found anything better yet. The only way I've found to effect the hard coded values like that is if I assume it's an address, then it flags, but every instance of that value gets flagged as that address even when it's not an address and of course a single value can only be named once.Something_Flag:
1da35: 99,00,00 cmpb R0,0
1da38: d7,03 jne 1da3d if ( true ) {
Seems like such a simple issue, maybe I'm overlooking something, but if anyone else disassembling the ford computers could give me any suggestions that would be great.
Besides working out a ford bin (EEC-V), I'm also working on an in house project to define and enforce requirements within functions for accurate pattern matching, like all temp vars start with the same data source and are processed in the same way. A side effect of that effort is I'd like to make it auto generate a DIR file for the file I'm looking at to save a load of time manually defining things that I've already done in another bin file. It's kind of a constraints logic type of system, match the pattern (generic), then check registers, data items, etc to make sure they are the correct pattern within the mask pattern basically. Like R74 might be used in one computer and R46 in another. Data items like say injector high slope needs to be referenced in the subs in the same way for it to be the same code. Basically automating the process of matching functions up and knowing with a high degree of certainty that they are matching and the data items, subs, etc are accurate, and any code changes gets flagged for manual review but with the other items defined that don't conflict. That's where the DIR output comes in, I don't want to build my own disassembler when one already exists. I'm just doing simple pattern matching and loosely looking at the op codes to make sure I get the lengths correct, register locations, etc.
I'm kind of shocked the SAD program doesn't offer a pattern matching system like this, or maybe it's undocumented? I know there's some level of pattern matching being done, but not sure where the program grabs the data from for that or if it's hard coded.