EEC V file conversion

All hardware related, disassembly / programming and code discussions belong here.
BOOSTEDEVERYTHING
Posts: 235
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

There was a mention of word alignment in the indirect address mode section, I just do not remember, and can not find where it says how it is accomplished, I guess the fill is skipping a spot to properly align the address?
BOOSTEDEVERYTHING
Posts: 235
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Code: Select all

8f91e: c7,e0,9a,13        stb   R13,[Re0+9a]     [1111a] = IO_Timer_Hi;
8f922: a1,52,f9,36        ldw   R36,f952         R36 = f952;
8f926: a1,64,0f,38        ldw   R38,f64          R38 = f64;
There is a reference to f952. I just figured maybe it was pointing to zero, I honestly did not think of it being a structure, mainly because it is all zeros.
BOOSTEDEVERYTHING
Posts: 235
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Code: Select all

8f922: a1,52,f9,36        ldw   R36,f952         R36 = f952;
8f926: a1,64,0f,38        ldw   R38,f64          R38 = f64;
8f92a: b1,04,46           ldb   R46,4            R46 = 4;
8f92d: a1,ed,cb,3a        ldw   R3a,cbed         R3a = cbed;
8f931: f2                 pushp                  push(PSW);
8f932: fa                 di                     interrupts OFF;
8f933: 20,03              sjmp  8f938            goto 8f938;

8f935: c2,39,34           stw   R34,[R38++]      [R38++] = R34;
8f938: 10,08              rombk 8
8f93a: a2,37,34           ldw   R34,[R36++]      R34 = [R36++];
8f93d: c7,01,62,0f,3a     stb   R3a,[R0+f62]     [10f62] = R3a;
8f942: c7,01,6e,0f,3b     stb   R3b,[R0+f6e]     [10f6e] = R3b;
8f947: e0,46,eb           djnz  R46,8f935        R46--;
                                                 if (R46 != 0) goto 8f935;
8f94a: c7,01,6c,0f,34     stb   R34,[R0+f6c]     [10f6c] = R34;
8f94f: f3                 popp                   PSW = pop();
8f950: f0                 ret                    return;

8f951: ff                 ???   

8f952: 00,00              word      0
8f954: 00,00              word      0

8f956: 00,00,00           ???   
Perhaps a long indexed address mode? But again, it is confusing me because it is all zeros.
jsa
Posts: 274
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

Adding in the caller to your post. Another word confirmed at 8F8DA
BOOSTEDEVERYTHING wrote: 2024 Mar 27, 21:18

Code: Select all

 
    Sub_8f976:
8f976: f2                 pushp                  push(PSW);
8f977: a3,ec,34,38        ldw   R38,[Rec+34]     R38 = [117b4];
8f97b: ad,04,36           ldzbw R36,4            wR36 = 4;
8f97e: 2f,d9              scall 8f959            Sub_8f959 ();
8f980: f3                 popp                   PSW = pop();
8f981: f0                 ret                    return;
 
   Sub_8f959:
8f959: 10,08              rombk 8
8f95b: 6f,37,d6,f8,38     ml2w  R38,[R36+f8d6]   lR38 *= [R36+8f8d6];        #<<<<<<<<<< lr38 *= [8F8DA]
8f960: 0d,01,38           shldw R38,1            lR38 <<= 1;
8f963: d3,03              jnc   8f968            if (B15_R3a = 1)  {
8f965: bd,ff,3a           ldsbw R3a,ff           swR3a = ff; }
8f968: c3,37,0a,11,3a     stw   R3a,[R36+110a]   [R36+1110a] = R3a;
8f96d: 09,01,36           shlw  R36,1            R36 <<= 1;
8f970: c3,37,42,0f,3a     stw   R3a,[R36+f42]    [R36+10f42] = R3a;
8f975: f0                 ret                    return;
Added subsequent code to your post.
You have not looked far enough to spot the loop that references another four words up to 8F8DE

Code: Select all

02504: 01,4e              clrw  R4e              R4e = 0;
02506: 10,08              rombk 8
02508: a3,4f,d6,f8,50     ldw   R50,[R4e+f8d6]   R50 = [R4e+8f8d6];     <<<<<<<<<< 8F8D6..8F8DE
0250d: 05,50              decw  R50              R50--;
0250f: db,02              jc    02513            if (R50 < 0)  {
02511: 01,50              clrw  R50              R50 = 0; }
02513: c2,4d,50           stw   R50,[R4c++]      [R4c++] = R50;
...
0251e: 75,02,4e           ad2b  R4e,2            R4e += 2;
02521: 99,10,4e           cmpb  R4e,10           
02524: d3,e0              jnc   02506            if (R4e < 10) goto 02506;         <<<<<<<<<


Added subsequent code to your post.
You have not looked far enough to spot the loop that references all words up to 8F8E4.

Code: Select all

   Sub_8f8e6:
8f8e6: a1,40,0f,36        ldw   R36,f40          R36 = f40;
8f8ea: a1,d6,f8,34        ldw   R34,f8d6         R34 = f8d6;
...
8f90a: 89,e6,f8,34        cmpw  R34,f8e6         
8f90e: d3,de              jnc   8f8ee            if (R34 < f8e6) goto 8f8ee;       <<<<<<<< 8F8E4 is the last word reference that will be looped.
here is where I see 8f8d6 referenced as a word value
What have we proven?

What can be said about SAD?

Do you use the branch (jump) comments I provided with RZASA?
Would automatic SAD produced branch comments help spot the loops in subsequent code in OMAE2?
jsa
Posts: 274
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

BOOSTEDEVERYTHING wrote: 2024 Mar 27, 21:33 There was a mention of word alignment in the indirect address mode section, I just do not remember, and can not find where it says how it is accomplished, I guess the fill is skipping a spot to properly align the address?
No mention is made of how IIRC, just that it should be even.
So yes FF fills the odd address and the word is on an even address.
BOOSTEDEVERYTHING
Posts: 235
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

What have we proven?
That 8f8d6 8f8de should be defined with the word command, and just because the words in between aren't directly referenced in the code, they are present so they can be indirectly referenced.
I do have one question about this though, should the word command be used in a range or should I do the addresses individually?
What can be said about SAD?
Very user driven. If you do not know exactly how to use it, it will get you completely lost.. LOL
Do you use the branch (jump) comments I provided with RZASA?
I do, but wasn't paying attention to rzasa code when I was looking for the words referenced above.
Would automatic SAD produced branch comments help spot the loops in subsequent code in OMAE2?
Absolutely, that makes it a ton easier to follow the code. I was not going far enough to see the loop, I may have seen it if i was following in RZASA due to the cmt file you provided me. I guess I need to try and make one for OMAE2.

Also, I guess I need to pop over to the other thread and ask if TVRFAN could incorporate the looped scan command and possibly SAD produced branch comments, and loop comments. Also, SAD 5 still doesn't like an address to have both a word value and byte value assigned to it, but it does work in SAD 4.012....mostly.
jsa
Posts: 274
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

BOOSTEDEVERYTHING wrote: 2024 Mar 27, 22:29 That 8f8d6 8f8de should be defined with the word command, and just because the words in between aren't directly referenced in the code, they are present so they can be indirectly referenced.
I do have one question about this though, should the word command be used in a range or should I do the addresses individually?
Indeed, indirect and indexed address modes can reference a series of addresses in a loop.
A range will get the job done quickly, so go with that.

What can be said about SAD?
Very user driven. If you do not know exactly how to use it, it will get you completely lost.. LOL
The mantra is user is king, so it will not save you from garbage in garbage out.
It does not capture the extent of loops, so the user has to be awake to that.

Do you use the branch (jump) comments I provided with RZASA?
I do, but wasn't paying attention to rzasa code when I was looking for the words referenced above.
Yeah, not so much as a comparison source for OMAE, just asking if it were useful for RZASA alone.

Would automatic SAD produced branch comments help spot the loops in subsequent code in OMAE2?
Absolutely, that makes it a ton easier to follow the code. I was not going far enough to see the loop, I may have seen it if i was following in RZASA due to the cmt file you provided me. I guess I need to try and make one for OMAE2.
I agree it is so much easier with the jump comments in place.
Generating it line by line is a long and tedious process. I wised up eventually and have a less tedious process, but really messy to do. The DIR and LST are not quite ready for that yet.

Also, I guess I need to pop over to the other thread and ask if TVRFAN could incorporate the looped scan command and possibly SAD produced branch comments, and loop comments. Also, SAD 5 still doesn't like an address to have both a word value and byte value assigned to it, but it does work in SAD 4.012....mostly.
One voice requesting this stuff does not carry as much weight as two...or more.
Yes, ask for the scan command to be updated to support range.
Yes, ask for the branch (jump) comments to be generated by SAD.

V4 ignores the duplicate byte and word.
V5 requires a size option for the sym command. I have not tested these yet, I hope they work when I get a chance, as I'd hate to bury TVRfan under more bugs right now.
jsa
Posts: 274
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

BOOSTEDEVERYTHING wrote: 2024 Mar 27, 20:13 I did. I did all of the SCA commands and then went through and found the Subroutines. Should I have gone through and deleted the SCA commands that happened to land on a defined Subroutine?
Yes, Sub command triggers a scan. Both in place will give the duplicate command error.


This includes an updated DIR and the old DIR with changed sort order.
Please use this new one. You can add more to it, such as payloads, scalars, functions, tables and subs.
OMAE2.zip
(24.76 KiB) Downloaded 8 times
See comments in the file, ask questions if need be.

While table and function commands can have a name, eliminating the need for SYM, my time with V5.08 and Math has convinced me that the FUN & TAB line gets way to long when the name is not on a separate SYM line.
I noticed you liked adding X10 options to convert from hex to decimal. I find it better to use V where possible to convert to engineering units.
Note V1 gives the same answer as X10, something to ponder for better math in V5.08 on.

You will see some Fn & Tb comments as investigate size. I have investigated, check them out, see if it makes sense why I've chosen the size.
Look back at your previous troublesome example, see how it looks now.

I think the stuff I've changed is correct, happy to be proven otherwise.
BOOSTEDEVERYTHING
Posts: 235
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Yeah, not so much as a comparison source for OMAE, just asking if it were useful for RZASA alone.
Yes, Very useful.. I wish I could build them as fast as you can. I still have trouble spotting the loops in the code most times. I also still have issues following along with exactly where the code goes and where exactly it comes back to. But I am getting the hang of it. I wish it would have exact addresses (or line numbers) listed for where to go next so it was easier to go back and forth to follow along.

I will check out the new DIR file today and compare and see how I can improve upon my other DIR file. Do most of the addresses I found for the SYM commands in the old DIR file still hold true, or do I need to start from scratch with those?
BOOSTEDEVERYTHING
Posts: 235
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

sym 12364 "uuwFn072A_Perload>Row" # Row Scaler
FUN 12364 1237F :UW V32768 :UW V16
Another question I have is, Where exactly are the function names, table names, etc, that everyone uses as standard coming from? Do they come from the eec documents or a specific code that was disassembled in the past?

My other question is a bit off topic, It says Australia in your bio but doesn't say where? I was wondering what time zone you are in? Just curious I guess.

Also, I have tried adding a sym for table names or subroutines names but it gives me duplicate command errors at times. Is there a certain format to which I need to stick to when doing separate entries for these? And do I keep the SYM with the Func command or in the SYM list?
Thanks again for all the help.
Post Reply