TripleBlackVert wrote:thanks michael. this approach was originally suggested by cgrey as a way to address the issue of discovering more thoroughly the places where the FORD programmers put paramters for functions directly after the call instructions. i took it to the next level by deciding to actually create a simulator to be able to really run the code.
I was watching that interchange. Discovering the places where passing parameters inline happens is fairly simple if you take the trouble to work out what the instructions are doing. It can be tedious to build up the dir file to accommodate them all; I think too tedious for cgrey, and he kept telling me that it was simple for a computer to do this tedious work.
Interestingly I think th esimulator way of doing this requires even more understanding of exactly what the instructions do. To drive the disassembler, you don't really need that. Like your cmp and carry flag example; it's enough to see that you have a loop zeroing memory. It doesn't really matter if the last thing it zeroes is 048A or 0489, but to program a disassembler, you need to do much more work to really understand things. Your carry flag example made me go back and think about how much I really understood what's going on. So, thanks.
TripleBlackVert wrote:
this project has multiple goals, one of which is to end up with a clean, commented disassembly. the other goals are:
- to learn c# in the process. after i get it worked out in c++, i plan to migrate it to c#
- to be able to simulate a run based on a real life datalog taken
I'm not sure it's so simple to log the raw inputs so you can use them as simulation inputs. I'm sure you'll find a way that's nearly as good though. I think it's drmayf on the Yahoo Tweecer group who has a hardware generator for several EEC-IV inputs. He's probably not the only one.
TripleBlackVert wrote:
- to be able to assemble code correctly, initially the disassemby back into the original binary
I'm sure you'll have no trouble with that. And assembling it back into the QH will be much easier and, I think, more useful.
I'll also be interested when you achieve that goal to hear whether you agree that building a simulator was a rather hard way to achieve a clean disassembly. :-)
TripleBlackVert wrote:
- to create a higher level language that can result in assembly or machine code for this processor.
- - this might be like FORTH or a subset of C, but it will be a pretty simple language
- eventually, to be able to write a completely new engine management system using this processor as the hardware
at that level of simplicity, code bloat will be a big issue, and I suspect you'll need to be thinking of recompiling for a bigger memory space.
A new EMS would be interesting work, but I believe it would be more effective to modify a later EEC-V ECU. The A9L is pretty primitive, it's just the most understood (publicly) for the obvious reasons. for example later EEC-IV ecus have an OBD2 style data link that can spew out data for logging, and accept data to run as code. Many people push A9L because more of it is believed to be understood.
TripleBlackVert wrote:re the first goal ... i have been a c++ developer for 20+ years, so that is my main strength. i don't want to be struggling with the language and the logic both at the same time, or i will more likely give up. after i get the logic figured out and working, i can focus on the language issues.
and yes, i am working towards an interactive enviromnent where i can put breakpoints in and look at things while running. i find it very interesting.
Watch out for those language issues of C/C++ arithmetic though. It's amazing how much you find out you don't know, working with a language standards group.
Sailorbob also told me, and he's right that doing disassemblies gets a lot easier after the first one.
I started on a simulator myself (after working on one for the Motorola 88000 years ago), but decided that my goals would be better met by working on my disassembler mods, and adding control flow data to it; giving myself a refresher on compiler technology. Doing it the harder way is always more interesting.
One feature of your simulator you might consider adding is an easy way to go straight to the place where a particular memory location is first stored to. I've found that useful when looking for particular variables.
Michael