Anyone willing to help me learn disassembly?

This is where the BIN Hackers and definition junkies discuss the inner workings of the EEC code and hardware. General tuning questions do not go here. Only technical/hardware-specific/code questions and discussions belong here.

Moderators: cgrey8, EDS50, Jon 94GT, 2Shaker

Post Reply
ironmanisanemic
Regular
Posts: 175
Joined: Tue May 24, 2011 8:33 pm
Location: Vandenberg AFB, CA

Anyone willing to help me learn disassembly?

Post by ironmanisanemic » Wed Oct 07, 2015 9:46 pm

As the title suggests im hoping someone can help me learn disassembly. I understand some of the basics, but when i look at the code it doesnt make sense to me. I dont have a programming background so that may make things easier to or harder. Im not expecting hand holding, i am willing to do the work, i just need to know how to understand what im looking at and how to interpret what's be going on. I have 2 bins i want to try and make definitions for. 1 is a 87 SD bin that has cruise control integrated. The 2nd is from my old 2000 taurus. I realize the SD would be the easier of the two, and thats the one im more apt to start with. If nobody is interested in helping i understand, from what i have read this is a very big undertaking, and i realize people have lives outside of this as do I, so i wont take it personally.

Thank you
1989 Ford Bronco:
-393W, Edelbrock Performer RPM heads, ProComp Upper and lower intake, Custom Comp Hyd Roller cam, 10:1 compression, 30lb injectors, 75mm TB, Pro-M 80mm MAF, equal length short tube headers, 2.5 inch y pipe merged into single 3 inch with hooker aerochamber muffler and no cat, QH w/ BE and EA running U4P0, AOD

1995 Ford Mustang GT
-Bone stock minus the QH. 5 Speed. T4M0

tvrfan
Tuning Addict
Posts: 368
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: Anyone willing to help me learn disassembly?

Post by tvrfan » Wed Oct 07, 2015 11:07 pm

As it's here, I assume you mean assembly code as used in the EEC boxes. Although this might sound like a brush-off, it's not meant that way.....read on.

Basics - (you may already be higher than this, please don't be offended - I'm covering all the bases)

The EEC boxes are a custom computer, with a central processor, memory (read only and read/write), and various inputs and outputs. There are a HUGE number of these kind of 'process control' systems around the world, in a huge wide range of stuff, large to small, from steel factories to smart TVs.

So, you need to understand the basics of how computer opcodes work before going anywhere, and some idea of how the CPU and its structure works. What say the basic LDX instruction does, how interrupts work and so on. How the CPU does compares ( if A > B) If you don't get a good understanding of this first step, then nothing else will make sense.
Some knowledge of how the STACK works as well, otherwise some of the EEC code will be impossible to get your head around.

The best thing is to search for web articles on a simpler CPU and how it works, at the instruction level.

When you have a reasonable understanding of this, and ideally a high level language (because they are good for getting you head around the idea of LOGIC flow, rather than just the arithmetic), you then have the tools to see structure in the opcodes, and be able to interpret what they are doing. That's the hard step.

'C' is actually tough to learn from scratch, especially some of its weird/power features, not sure what to recommend here.....Anyone ?

I don't want to sound superior or condescending, but it's hard not to.....
I've spent over 30 years in IT, starting as a programmer, and it still takes me a while to understand what some of the EEC code is doing sometimes. I've done quite a lot of 'C' and similar languages, in older days, our debugger used to spit out the lowest level opcodes/instructions AFTER the crash, so we had to be able to link it back to the code we wrote. It was slow and painful. That doesn't happen so much now, symbolic debuggers show the error in the code as written. But the old way gives you insights.
I can still add up in hexadecimal, that's how sad I am.....

Here's an example that I instantly spotted from A9l and I know what it does immediately (I edited a bit to make it clearer)....but to someone without experience it's a HUH ???
That's not an easy thing to learn....

Code: Select all

cmpb  R9a,a4                                              address 2151
 jc    2172          if (R9a < a4)  {
ldzbw R30,R9a        R30 =  R9a;
ad2w  R30,218a       R30 += 218a;
push  2151
push  [R30]
ad2b  R9a,2          R9a = R9a + 2;
ret       }
sjmp 2172                                             address 2172
You need to be able to recognize that pretty quickly for what it does.

I don't want to put you off, but just to warn you this is not an easy task unless you've got a lot of programming under your belt ....
(apologies if this is too low level...)
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

ranga83
Gear Head
Posts: 53
Joined: Thu Jan 03, 2013 8:33 am

Re: Anyone willing to help me learn disassembly?

Post by ranga83 » Thu Oct 08, 2015 2:37 am

decipha has a topic going on his website. http://forum.efidynotuning.com/viewtopi ... =30&t=1042

sailorbob
BIN Hacker
Posts: 1650
Joined: Tue Jul 12, 2005 6:10 am

Re: Anyone willing to help me learn disassembly?

Post by sailorbob » Thu Oct 08, 2015 7:57 am

As you don't have any programming experience then maybe something like the "Microprocessors and Microcontrollers - Architecture, Programming and System Design - 8085, 8086 8051 and 8096" book is a good starting point. It's not eec specific but then that's not what's needed initially and the 8096 is close to the 8061.

ironmanisanemic
Regular
Posts: 175
Joined: Tue May 24, 2011 8:33 pm
Location: Vandenberg AFB, CA

Re: Anyone willing to help me learn disassembly?

Post by ironmanisanemic » Thu Oct 08, 2015 7:11 pm

tvrfan wrote:As it's here, I assume you mean assembly code as used in the EEC boxes. Although this might sound like a brush-off, it's not meant that way.....read on.

Basics - (you may already be higher than this, please don't be offended - I'm covering all the bases)

No offense taken, im pretty humble about things I dont understand.

The EEC boxes are a custom computer, with a central processor, memory (read only and read/write), and various inputs and outputs. There are a HUGE number of these kind of 'process control' systems around the world, in a huge wide range of stuff, large to small, from steel factories to smart TVs.

So, you need to understand the basics of how computer opcodes work before going anywhere, and some idea of how the CPU and its structure works. What say the basic LDX instruction does, how interrupts work and so on. How the CPU does compares ( if A > B) If you don't get a good understanding of this first step, then nothing else will make sense.
Some knowledge of how the STACK works as well, otherwise some of the EEC code will be impossible to get your head around.

I understand a little, i can grasp the concepts of byte shifts, registers, and have a vague understanding of the stack. I will Do some more reading up on opcodes, the stack, interrupts, etc....

The best thing is to search for web articles on a simpler CPU and how it works, at the instruction level.

Do you have any that you would reccomend?

When you have a reasonable understanding of this, and ideally a high level language (because they are good for getting you head around the idea of LOGIC flow, rather than just the arithmetic), you then have the tools to see structure in the opcodes, and be able to interpret what they are doing. That's the hard step.

Learning a programming language is something ive wanted to do for a while. Back in High School i attempted to learn C++, but lost focus.

'C' is actually tough to learn from scratch, especially some of its weird/power features, not sure what to recommend here.....Anyone ?

I don't want to sound superior or condescending, but it's hard not to.....

No worries, i know there are tons of people more experienced than me.

I've spent over 30 years in IT, starting as a programmer, and it still takes me a while to understand what some of the EEC code is doing sometimes. I've done quite a lot of 'C' and similar languages, in older days, our debugger used to spit out the lowest level opcodes/instructions AFTER the crash, so we had to be able to link it back to the code we wrote. It was slow and painful. That doesn't happen so much now, symbolic debuggers show the error in the code as written. But the old way gives you insights.
I can still add up in hexadecimal, that's how sad I am.....

Here's an example that I instantly spotted from A9l and I know what it does immediately (I edited a bit to make it clearer)....but to someone without experience it's a HUH ???
That's not an easy thing to learn....

Code: Select all

cmpb  R9a,a4                                              address 2151
 jc    2172          if (R9a < a4)  {
ldzbw R30,R9a        R30 =  R9a;
ad2w  R30,218a       R30 += 218a;
push  2151
push  [R30]
ad2b  R9a,2          R9a = R9a + 2;
ret       }
sjmp 2172                                             address 2172
I do go HUH, but i can at least follow the code and know that its manipulating the data, but for what purpose i dont know

You need to be able to recognize that pretty quickly for what it does.

I don't want to put you off, but just to warn you this is not an easy task unless you've got a lot of programming under your belt ....
(apologies if this is too low level...)

Its going to take more than this to put me off, i never went into this thinking it was going to be easy. I just was hoping someone could take me under their proverbial wing and help me go from start to finish. Im a better learner when im actually doing than with my nose burried in a book
sailorbob wrote:As you don't have any programming experience then maybe something like the "Microprocessors and Microcontrollers - Architecture, Programming and System Design - 8085, 8086 8051 and 8096" book is a good starting point. It's not eec specific but then that's not what's needed initially and the 8096 is close to the 8061.

Im going to get that book ASAP, it seems like a pretty good one. Thanks for the suggestion!
1989 Ford Bronco:
-393W, Edelbrock Performer RPM heads, ProComp Upper and lower intake, Custom Comp Hyd Roller cam, 10:1 compression, 30lb injectors, 75mm TB, Pro-M 80mm MAF, equal length short tube headers, 2.5 inch y pipe merged into single 3 inch with hooker aerochamber muffler and no cat, QH w/ BE and EA running U4P0, AOD

1995 Ford Mustang GT
-Bone stock minus the QH. 5 Speed. T4M0

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest