DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

New to source code editing

Thread Tools
 
Search this Thread
 
Old 04-29-2016, 09:05 PM
  #1  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
New to source code editing

So here is my dilemma, I am really interested in the potentials of source code editing for our ecms but it seems like alot of the information on here is very outdated.

I have read all of the threads on source code editing and almost all the links are no longer there. I would really like to continue to learn this stuff and help others out as well.

So the ecm I will be using is a '7730 ecm and I want to run a $A1 mask on it. This is because I want the DIS from the FWD and MAP sensor with other features as well.

BUT... In the future I want to put forced induction on which I know will require a 2 bar MAP sensor. With this I also want to learn the basics of source code editing and patching.

What I already know: Some kind of dissasembler, I got the TUNERCATS dissasembler and when I dissasembled a bin it put it into an .src file.
When I open it up in note pad I have a vague Idea of whats going on but really don't know what parts of the program do what so I really don't know what to comment on to remember. I don't know if you can use the hex editor in Tunerpro RT to find values where things are located or what.

Then I don't know what to use for an assembler. I can not find a link for the as6811 assembler that was talked about in the old threads.

I know actually understanding the assembly language will need some practice but I am definately willing to put in the time if someone wants to teach me or if they still think it is worth it.

Thanks,

Drew
Old 04-30-2016, 02:01 AM
  #2  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

I use IDA pro for disassembly.

What exactly are you wanting to write up for coding?
Old 04-30-2016, 02:26 PM
  #3  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

camaroyoungster, couple of things to discuss. Using $A1 because it has been used for DIS is not required. The $8D code base will also run DIS, and is a better start.

$8F is already 2-bar MAP compliment, and was also used with a DIS system. This was on the '89 - '92 (or so) FWD 3.1l Turbo Grand Prix's. There is also $58, which GM used in many turbo cars.

All of the above have disassembled hacs available. Some are well commented which is a blessing to those just starting out.

I wrote my own disassembler as at the time there weren't any available at a reasonable cost.

I use Dunfields cross-assembler for assembling source into a S19 file. Then use home built tools to convert into a BIN. It can handle large source code files.

I have also used AS11 to assemble code, but it can only handle smaller files. I did this first to create patch files for BINs. This is a good way to start out learning the code.

RBob.
Old 04-30-2016, 03:13 PM
  #4  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Thanks for giving me some feedback, to be honest I really didn't know where to start with masks but that is definitely pointing me in the right direction.

Now if there are already hacs out there to mess with, what would I now have to do be able to assemble them back into a bin. I guess I can just use AS11 to patch for now because I really don't need to do anything bigger than that. I have a machine that is running windows 10 and I have previously tried running that to see if I could get it to work but I really don't know what it all needs to run.

Drew
Old 05-01-2016, 01:05 AM
  #5  
???
Senior Member

iTrader: (5)
 
???'s Avatar
 
Join Date: Aug 2006
Posts: 664
Likes: 0
Received 10 Likes on 9 Posts
Re: New to source code editing

I've thought about this for a while too. I've read everything I could find years ago and then again a while ago. it's just that first jump I guess,.. I haven't made it yet lol.

I do have a few questions too. a hack, is that just a bin file, like say the s_aujp that when you disassemble it, export it to a file and opened in plain old notepad, will have comments show up next to the lines of code? or are these separate files that are just hacks.


and yes, as I understand it, if you have a well defined xdf, you can kinda cross reference that location of the values, and guess get an idea of where what is. and there's some section of the oem chip manual to download, so you understand the short cuts and what the terms mean.


as what bin to start with, Rbob gave good info, the dis is easy to adjust for just using tunerpro settings. at this point, 8D has a great bin with the S_aujp project. now that it seems the AE and DE adjustments are well documented. back when I tried it 5 or 6 years ago, AE made me want to throw my laptop out of the window haha. but everything else ran great. I switched to a easier to understand code, but I'll probably go back and try again for my na project later. big thing I see would be going thru and converting to 2 bar, which I think is very involved, and probably not so much noob project. you'd need deep understanding of how the code works, I'm guessing just about everything is map value based. maybe just a map2 input fuel and spark table would be easier. but I don't know.

and then a E85 sensor input and somehow a table modifier to change the target af and timing, or some way to get the low octane part of the stock code involve?

anyways. as you go along and dive in. please follow up here. I'd like to follow and see how it goes.

oh and it seems like Windows itself is a hassle, since more of these programs aren't main stream. when Windows changes everything. it's not backwards compatible. which sucks too
Old 05-01-2016, 10:14 AM
  #6  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by camaroyoungster
Thanks for giving me some feedback, to be honest I really didn't know where to start with masks but that is definitely pointing me in the right direction.

Now if there are already hacs out there to mess with, what would I now have to do be able to assemble them back into a bin. I guess I can just use AS11 to patch for now because I really don't need to do anything bigger than that. I have a machine that is running windows 10 and I have previously tried running that to see if I could get it to work but I really don't know what it all needs to run.

Drew
See this link:

https://www.thirdgen.org/forums/diy-...thod-demo.html

To open a DOS type command window: Start->Run, then enter CMD and hit the enter key. Can then run AS11 and the patch utility.

As for assembling the source code, will need to edit it first. The code formatting varies some between different assemblers. And hacs that have the line numbers and addresses listed will need them removed.

RBob.
Old 05-01-2016, 03:31 PM
  #7  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok, I guess could we start from the beginning?

Reading the patch method demo thread assumes that you already have it at the part where all you have to do is change the code and re assemble it. I don't know where to begin so that is why I am asking.

I now have a .bin for the 3.1 turbo grand prix and a text file with I am pretty sure the actual code.

So I am assuming I need to disassemble the bin first but what would be the best program to use to disassemble? I guess what would you reccommend?

Do I need to get it into a .dis or a .src?

Thanks for putting up with me, definitely a rookie but it really interests me.

Drew
Attached Files
File Type: txt
8F hack.txt (541.9 KB, 476 views)
File Type: bin
AUAF_89_TGP_3_1Turbo.bin (32.0 KB, 9 views)
Old 05-02-2016, 11:51 AM
  #8  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

The patch method demo is not about reassembling the entire source. It is where a small source file is created that is over-laid on top of a current BIN file. Thereby 'patching' it.

The 8F_hack.txt file is already disassembled into source. It needs work to make it into something that will assemble. But that isn't required (not yet at least).

Read through the 8F_hack until you start to understand the code. Then what changes do you want to make. Having the Motorola pink book is also required as it lists the CPU operations and how they work.

Chapter 4 is the one to study:

http://www.nxp.com/files/microcontro...t/M68HC11E.pdf

RBob.
Old 05-02-2016, 04:33 PM
  #9  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

So in the .txt file I am assuming from line 0000 to 9FF0 are the values that are set to begin with like what you actually change in a tuner program like tuner pro. Then starting at A000 is where the actual program starts:
; INITIALIZATION ROUTINES
;--------------------------------------------------------
A000 ILOPRT:lds #0x01FF ;SET USER STACK
A003 jsr LF160 ;GO DO FACTORY TEST
A006 ldd #0xEB1A
A009 std L3FFC ;CPU CONTROL REG
lds: Load stack pointer
jsr: Jump to subrountine
ldd: Load double accumulator d
std: store accumulator d

But are the values that are right after them addresses for other lines to reference?

I guess this is where things start to get confusing for me.

I know from basic programming the LF160 is a label for line F160 where it jumps to do the factory subroutine so the lines that have an L in front of them make sense.

So does that mean the#01x01FF an integer that it loads to the stack pointer?
Old 05-02-2016, 04:51 PM
  #10  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by camaroyoungster
So in the .txt file I am assuming from line 0000 to 9FF0 are the values that are set to begin with like what you actually change in a tuner program like tuner pro. Then starting at A000 is where the actual program starts:
lds: Load stack pointer
jsr: Jump to subrountine
ldd: Load double accumulator d
std: store accumulator d

But are the values that are right after them addresses for other lines to reference?

I guess this is where things start to get confusing for me.

I know from basic programming the LF160 is a label for line F160 where it jumps to do the factory subroutine so the lines that have an L in front of them make sense.

So does that mean the#01x01FF an integer that it loads to the stack pointer?
01ff is the address in ram where the stack is.
Old 05-03-2016, 10:46 AM
  #11  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

But when I looked in the code I couldn't find an address. All I could find is this and then later in the code it references it a few times but doesn't actually have a value.
;NON BATTERY BACKED STATIC RAM 0x0100-0x01FF
;----------------------------------------------------------------------------------------
00FE L0100 = 0x0100 ;FACTORY TEST MODE WD
0100 L0101 = 0x0101 ;DECAY COUNTER FOR CRANK TO RUN
0101 L0103= 0x0103 ;O2 CROSS COUNTS
0103 L0104 = 0x0104 ;MALF 53 QUALIFICATION TIMER
0104 L0105 = 0x0105 ;TPS 4
And it only goes up to 0x02DE.

Does it not need that to function?
Old 05-03-2016, 11:04 AM
  #12  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

It may not be commented in whatever your looking at and its not going to be in the bin file since ram is separate from the prom.

The stack takes a lot of space so 02DE-02ff is probably all stack.
Old 05-03-2016, 12:33 PM
  #13  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by camaroyoungster
So in the .txt file I am assuming from line 0000 to 9FF0 are the values that are set to begin with like what you actually change in a tuner program like tuner pro. Then starting at A000 is where the actual program starts:
lds: Load stack pointer
jsr: Jump to subrountine
ldd: Load double accumulator d
std: store accumulator d

But are the values that are right after them addresses for other lines to reference?

I guess this is where things start to get confusing for me.

I know from basic programming the LF160 is a label for line F160 where it jumps to do the factory subroutine so the lines that have an L in front of them make sense.

So does that mean the#01x01FF an integer that it loads to the stack pointer?
Lets break it down some:

Code:
A000	ILOPRT:	lds	#0x01FF			; SET USER STACK
The # means that it is an immediate value, taken as is and loaded into the stack pointer. That location (0x01FF) is also the last of the RAM in the '7727 ECM.

Code:
A003		jsr	LF160			; GO DO FACTORY TEST
This jump and set return uses the label of LF160 for the address of the subroutine. Wherever that label ends up in the BIN is where the jump takes place to.

Code:
A006		ldd	#0xEB1A
Again, the # means to load this value as-is.

Code:
A009		std	L3FFC			; CPU CONTROL REG
Which is then stored in ECM hardware at address 0x3FFC. Note this line in the source:

Code:
3FFA	L3FFC	=	0x3FFC		; CPU CTL REG
That hardcodes the label of L3FFC to the physical location of 0x3FFC.

Note that in front of the above lines of code are values such as: A000, A003, A006, A009, and 3FFA. To assemble this source they need to be removed.

RBob.

Last edited by RBob; 05-03-2016 at 12:36 PM.
Old 05-03-2016, 03:48 PM
  #14  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok this makes more sense now. So the program on the EEPROM tells the computer to store a certain value from earlier in the program to the RAM so then it can be manipulated in however it is supposed to.

Looking at table 2-4 of the M68HC11.pdf you have it lists all of the address's for the ram and they are noted as 0x0000-0xFFF but this ecm only uses up to 0x6000?

Next question:

How does the program reference the address or the values at that address in the program:

Code:
ESC ATTACK RATE VS RPM
        RPM
-------------------------------------
82D9  06     400
      08     1200
      0A     2000
      0B     3200
      0E     4800
Where it later is referenced:

Code:
AF35        ldx    #0x82D9                ;ESC ATTACK RATE VS RPM
82D9 is referenced as #0x82D9 so does the program store those values in the ram momentarily while it compares values?

Last edited by camaroyoungster; 05-03-2016 at 05:05 PM.
Old 05-04-2016, 08:10 AM
  #15  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by camaroyoungster
Looking at table 2-4 of the M68HC11.pdf you have it lists all of the address's for the ram and they are noted as 0x0000-0xFFF but this ecm only uses up to 0x6000?
Skip all but chapter 4 of the M68HC11 document. The uProc that GM uses is custom, not an off the shelf device. Studying chap 4 will answer the other questions.

RBob.
Old 05-04-2016, 08:37 PM
  #16  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok, I'll make sure to study that more. I guess moving forward, I have found the code for a "soft rev limiter". How exactly would I change the rpm value in the code so it has a lower rev limiter.

Code:
        ;-----------------------------------
            ; ?? SOFT REV LIMIT
            ;-----------------------------------
C1D5    LC1D5:ldy    #0x864E                ;1ST OPTN FLAG
C1D9        brset    0x00,y,#0x10,LC1E1              ;BRANCH IF BIT SET 4 = ? (BIT CLEAR)
C1DE        jmp    LC27C

C1E1    LC1E1:ldy    #0x8650                ;3RD OPTN FLAG
C1E5        brset    0x00,y,#0x20,LC210        ;BRANCH IF BIT SET 5=?? (BIT CLEAR)
C1EA        brclr    *L003D,#0x20,LC206              ;BRANCH IF NOT IN POWER ENRICHENT, ELSE 
C1EE        ldaa    L86C9                           ;FF  6375 RPM
C1F1        brclr    *L002E,#0x08,LC1F8        ;BRANCH IF SPARK OFF, ELSE
C1F5        ldaa    L86C8                           ;FF  6375 RPM
C1F8    LC1F8:cmpa    *L005F                ;RPM/25
C1FA        bcc    LC206                    ;BRANCH IF 86C9 OR 86C8 >= RPM/25, ELSE
C1FC        bset    *L002E,#0x08                 ;REV LIMITER? OVER 6350 RPM? VEH MOVING?
C1FF        ldd    *L0088                       ;GET THE PULSE WIDTH
C201        jsr    LC31A                           ;SET THE NEW BPW
C204        bra    LC20E                    ;BRANCH

C206    LC206:bclr    *L002E,#0x08                  ;SPARK ON FLAG?
C209        clra                        ;CLEAR A
C20A        clrb                        ;CLEAR B
C20B        std    L1819                           ;KILL SPARK
C20E    LC20E:bra    LC248                    ;BRANCH
I think that there is actually more of this piece in regards to the rev limiter that goes into fuel cut but I am not sure. I just didn't want to copy all of the extra code.
Old 05-04-2016, 10:07 PM
  #17  
Senior Member

iTrader: (2)
 
TallTim's Avatar
 
Join Date: Mar 2010
Location: South FL
Posts: 524
Received 26 Likes on 19 Posts
Car: 1989 Formula T-Top
Engine: 350 TPI + some bits
Transmission: 700R4
Axle/Gears: 3.27
Re: New to source code editing

Originally Posted by RBob
See this link:

https://www.thirdgen.org/forums/diy-...thod-demo.html

To open a DOS type command window: Start->Run, then enter CMD and hit the enter key. Can then run AS11 and the patch utility.

As for assembling the source code, will need to edit it first. The code formatting varies some between different assemblers. And hacs that have the line numbers and addresses listed will need them removed.

RBob.
Damn that RBob is dredging up his expert posts from 14 years ago! Now that is some commitment to TGO. Thanks RBob!
Old 05-05-2016, 08:11 AM
  #18  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by camaroyoungster
Ok, I'll make sure to study that more. I guess moving forward, I have found the code for a "soft rev limiter". How exactly would I change the rpm value in the code so it has a lower rev limiter.
You don't, they are calibration parameters. See these two lines:

Code:
C1EE        ldaa    L86C9                           ;FF  6375 RPM
C1F5        ldaa    L86C8                           ;FF  6375 RPM
They are loading the calibration parameters for the rev limit.

RBob.
Old 05-05-2016, 04:56 PM
  #19  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok, so to change those values you actually have to use a tuning program? So I guess to actually learn how to add a patch to this program. I guess one thing that would be useful would be anti-lag when holding down a switch. Where would I start with that?

Drew
Old 05-05-2016, 05:19 PM
  #20  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by camaroyoungster
Ok, so to change those values you actually have to use a tuning program? So I guess to actually learn how to add a patch to this program. I guess one thing that would be useful would be anti-lag when holding down a switch. Where would I start with that?

Drew
You're a funny guy....

RBob.
Old 05-05-2016, 05:34 PM
  #21  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

I take it, it's not to easy? I guess I just need something simple to add so I can learn how it works.
Old 05-05-2016, 05:58 PM
  #22  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Hmm, this is a very interesting thread! Forgive me for intruding. I have experience programming a 6502 8-bit CPU in assembly/machine language.

If I understand correctly 'LDAA' is Load from A Accumulator with an 8-bit value(s) from Location(s) $86C9 & $86C8. The comments state that the value $FF is for 6375 RPMs. That is the highest RPM the CPU can deal with, so there is no rev limit from the ECM.
Old 05-05-2016, 06:11 PM
  #23  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Originally Posted by UltRoadWarrior9
If I understand correctly 'LDAA' is Load from A Accumulator with an 8-bit value(s) from Location(s) $86C9 & $86C8. The comments state that the value $FF is for 6375 RPMs. That is the highest RPM the CPU can deal with, so there is no rev limit from the ECM.
So if you change $FF to some other number it technically changes the highest the rpm can go? So does that also mean that if 255 corresponds to 6375 that if I changed $FF to $FE that would represent 254 which 254*25=6350?
Old 05-05-2016, 06:23 PM
  #24  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Originally Posted by camaroyoungster
So if you change $FF to some other number it technically changes the highest the rpm can go? So does that also mean that if 255 corresponds to 6375 that if I changed $FF to $FE that would represent 254 which 254*25=6350?
That is correct, but I would have rather thought of it like so: 6375-X*(6375/256)
Old 05-05-2016, 07:07 PM
  #25  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

But you actually can't change that value in the code? When I looked through it and used ctl+f and typed in 86C9 it would bring you to that value but the code doesn't use that value since there is no address for it or what? That's what I am kind of confused about. Rob said that is a calibration value but I don't know if it is stored in ram or what?
Old 05-05-2016, 07:15 PM
  #26  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Originally Posted by camaroyoungster
But you actually can't change that value in the code? When I looked through it and used ctl+f and typed in 86C9 it would bring you to that value but the code doesn't use that value since there is no address for it or what? That's what I am kind of confused about. Rob said that is a calibration value but I don't know if it is stored in ram or what?
Ah, so you are not so interested in the rev limiter function values for changing the RPM limit, you want to know how it exactly works... Maybe RBob can help. Out of my league as of now. CalPAK maybe? Wouldn't be non volatile RAM...
Old 05-05-2016, 07:44 PM
  #27  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by camaroyoungster
Ok, so to change those values you actually have to use a tuning program? So I guess to actually learn how to add a patch to this program. I guess one thing that would be useful would be anti-lag when holding down a switch. Where would I start with that?

Drew
How do you want this switch to work? You could easily set it up as conditional since switches into the ecu are hard to come by, then again this venture is hard to come by.
I'll gift you my anti lag code for a jump start.
Here: https://github.com/kerchakone/MerpMo.../MerpMod/ALS.c
Old 05-05-2016, 08:43 PM
  #28  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Thanks Vanilla, in the future I would love to do something like that but I guess in the moment I was trying to think of a feature I would like to add that isn't already in there that might be easy to add.

And ultroadwarrior, I guess it helps to understand things when you know where the values such as the max rpm come from since I really don't know how the cpu looks up values that are set to begin with.

I understand the basic operations that the computer can do for the most part. I also know that the cpu gets the values somehow and then stores them in RAM to be used later for other functions. I guess it's just learning how to piece them together to get the ECM to perform how you want it. But another thing is how does the computer read inputs change values compared to base values and then outputs those changes to change things such as pw or IAC.

I am sorry if it is a little frustrating trying to understand me but I guess it's how the cup works together with the memory as well as inputs and outputs.

Drew
Old 05-05-2016, 10:03 PM
  #29  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by camaroyoungster
Thanks Vanilla, in the future I would love to do something like that but I guess in the moment I was trying to think of a feature I would like to add that isn't already in there that might be easy to add.

And ultroadwarrior, I guess it helps to understand things when you know where the values such as the max rpm come from since I really don't know how the cpu looks up values that are set to begin with.

I understand the basic operations that the computer can do for the most part. I also know that the cpu gets the values somehow and then stores them in RAM to be used later for other functions. I guess it's just learning how to piece them together to get the ECM to perform how you want it. But another thing is how does the computer read inputs change values compared to base values and then outputs those changes to change things such as pw or IAC.

I am sorry if it is a little frustrating trying to understand me but I guess it's how the cup works together with the memory as well as inputs and outputs.

Drew
Well I would say adding antilag is not even close to easy.
It requires hacking at all levels of the rom. It doesn't get much more complicated.

Why don't you try making the ses flash when knock retard is greater than a certain threshold? Something easy like that.
Old 05-05-2016, 10:14 PM
  #30  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

That sounds like a fantastic idea. Thanks haha.
Old 05-10-2016, 05:41 PM
  #31  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok I did some more researching. In the program there are multiple times where the spark is being retarded. Do I have to add code in each place to put the ses on or is there a way to have both jump to just one location and then return?

Drew
Old 05-10-2016, 05:46 PM
  #32  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Easy, Find a place to "hook" the code jumping to a subroutine that you fully write. In the subroutine: read knock amount, is knock greater than threshold?
If yes light on, return from subroutine.
If no light off, return from subroutine.

There may be more to this to get it to flash or stay lit. That's part of the fun. You probably need to add in a check prior to the knock check that sees if the light is already on.

Done.

Now you can use this subroutine jump to run any code you wish. Just replace the return from subroutine to a jump to another then return from that one.

Last edited by Vanilla Ice; 05-10-2016 at 05:56 PM.
Old 05-11-2016, 11:27 AM
  #33  
Supreme Member

iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Re: New to source code editing

Here is the real issue when changing code...
Changing a variable/parameter value that is located at a particular address is easy. Find it, figure out its scale factor and then alter the value.
This only requires that the checksum of the program get updated (or put AA in there to ignore the checksum calculation.

To change the functionality there is a greater problem.
The code has some "lables" to points within the structure that are called by areas and routines. These "jump to" points are pretty clear once you begin to see them.
Problem is that there are "Indexed" addressing within the programs.
They call for a jump to a "number" of lines within the code, NOT an exact location.

If you were to add some lines of code to change the operation of one item, you could corrupt the entire program.

By editing ALL of the locations within the program and giving them all explicit "lables", then all jumps are handled correctly. Adding code does not cause a problem.
The alternative to this is "Patching".
This method requires you to insert changes so that the existing items do not shift and the placement or sequence remains the same. Counting hex character positions and manual figuring is required to pull that off.
Small changes can be done pretty easily this way but large formatting would be a nightmare.
The AUJP JP2 was made "Re-locatable" to allow changes as you are looking to do.
It took significant time to make the file that way so if you start with another BCC you can reference it to see what was done.
HTH,
Jp

Ps, I'd like to see boost added someday to $8D as well.
Old 05-11-2016, 11:42 AM
  #34  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by JP86SS

Ps, I'd like to see boost added someday to $8D as well.
Still working on this. Just haven't had time. Won't be too long once I can get back to it. I don't plan on running boost for another year or two so I'll need a tester or ten.
Old 05-11-2016, 11:43 AM
  #35  
Supreme Member

iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Re: New to source code editing

https://www.thirdgen.org/forums/diy-...mmies-ask.html

Its a long thread in the stickys but it is where many of us asked all the dumb questions we could until we saw "some" light at the end of the tunnel.
Helped to take the "starting" bin if it is one that hasn't been done before and start working with it.
Old 05-11-2016, 06:19 PM
  #36  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Why was the 68HC11 documentation recommended reading?
Old 05-11-2016, 06:37 PM
  #37  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok I tried my best to kind of piece something together to show that I somewhat know what is going on. This is turning on a check engine light (assuming it is already off) if the knock counts go past a certain threshold. I feel like it should be longer but I don't know.
Code:
LF60B:        ldab *L00A2        ;load knock counts to acumulator b
        cmpb L0FF        ;compare knock counts to knock threshold
        bhi LF613        ;branch if hi to 
LF613:        bset *L0038,#0x01    ;turn on check engine light
LF60B and LF613 would be at the end of the code so I know I have enough room for it.
L00FF is the last spot in the memory where the threshold for the knock counts would be held. please correct me if I am wrong

Drew
Old 05-12-2016, 09:11 AM
  #38  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,401
Likes: 0
Received 215 Likes on 201 Posts
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by UltRoadWarrior9
Why was the 68HC11 documentation recommended reading?
Chapter 4 only, it documents the instruction set and how the CPU utilizes it:

https://www.thirdgen.org/forums/diy-...ml#post6034624

RBob.
Old 05-12-2016, 05:44 PM
  #39  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Don't mean to hijack the OP's thread, so just one more question because I am extremely interested into getting to know the lowest level functions of the 165 and 730 ECMs...
You said GM uses a custom uProc. Do these uProc's have a 68HC11 core on these ECMs?
Or should I start another thread on this topic?

EDIT: Woops, missed this post about the sticky.
Originally Posted by JP86SS
https://www.thirdgen.org/forums/diy-...mmies-ask.html

Its a long thread in the stickys but it is where many of us asked all the dumb questions we could until we saw "some" light at the end of the tunnel.
Helped to take the "starting" bin if it is one that hasn't been done before and start working with it.
Checking it out...

Last edited by UltRoadWarrior9; 05-12-2016 at 06:36 PM.
Old 05-12-2016, 06:45 PM
  #40  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Originally Posted by camaroyoungster
Ok I tried my best to kind of piece something together to show that I somewhat know what is going on. This is turning on a check engine light (assuming it is already off) if the knock counts go past a certain threshold. I feel like it should be longer but I don't know.
Code:
LF60B:        ldab *L00A2        ;load knock counts to acumulator b
        cmpb L0FF        ;compare knock counts to knock threshold
        bhi LF613        ;branch if hi to 
LF613:        bset *L0038,#0x01    ;turn on check engine light
LF60B and LF613 would be at the end of the code so I know I have enough room for it.
L00FF is the last spot in the memory where the threshold for the knock counts would be held. please correct me if I am wrong

Drew
A couple questions:
1) How much RAM/ROM(EEPROM) does this ECM have? I guess a better way to ask this question nowadays, is how much volatile/non-volatile memory? Old school was RAM/ROM.
2) Where in the CPU memory do they reside? We have 64K here, correct? Meaning the memory map is from ($0000-$FFFF)
3) Where are the I/O locations inside that memory map?

Last edited by UltRoadWarrior9; 05-12-2016 at 06:48 PM.
Old 05-12-2016, 08:08 PM
  #41  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Originally Posted by UltRoadWarrior9
A couple questions:
1) How much RAM/ROM(EEPROM) does this ECM have? I guess a better way to ask this question nowadays, is how much volatile/non-volatile memory? Old school was RAM/ROM.
2) Where in the CPU memory do they reside? We have 64K here, correct? Meaning the memory map is from ($0000-$FFFF)
3) Where are the I/O locations inside that memory map?
I have been asking those questions because it would be easier to know where the values are coming from but nobody answered them. Rob said that it uses a custom uProc so it is just kind of going blind. This is why I started this thread so I can learn how the program references I/O's and how the computer references tables and such.

Please teach me haha.

The ecm that I would use is a '7730

Drew
Old 05-12-2016, 11:58 PM
  #42  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

The answers to those questions are very clearly marked in the commented disassemblies.
Old 05-15-2016, 01:57 PM
  #43  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok so those are the actual locations, that really helps out. I wasn't really sure to begin with. So I guess where in the actual part of the code should I put the knock threshold value? It looks like the code is divided up into parts and I really don't know where It would work.

0000-00FF is battery backed static ram.
0100-1FF is non battery back static ram.
Then it skips to 0400-04FF for the Gm Hud debugging stuff
Then in the text file it gets kind of confusing where labels are not necessarily lined up with line # in the text file. Then what are the values starting at line 8000?
Code:
89GPT.BIN->K:\EPROM\GPTURBO\GPTRUBO.MAP

8000  1447                 PROMID
8002  09E1                 EPROM DATE CODE
8004  0412                 PRODUCTION SEQUENCE NUMBER
8006  B1B8                 CHECKSUM
8008  8F                PROGRAM ID WORD 
8009  C0    192    6 CYLS    KNUM CYLINDERS
800A  0889    2185    600 RPM    STARTUP RPM-SPARK
800C  0B61    2913    450 RPM    STARTUP RPM-FUEL           
800E  3C     60    6000 RPM    REDLINE (REPORTED IN ALDL MODE __)
800F  01C0    448    5.6 SEC    ECM SHUT DOWN TIME
here is the start just for an example. Is it here I can put threshold value? when I am looking in the actual code that does operations I can see that it references the values but don't the 8XXX values get removed from the code?
Old 05-16-2016, 11:47 AM
  #44  
Supreme Member

iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Re: New to source code editing

Originally Posted by camaroyoungster
So in the .txt file I am assuming from line 0000 to 9FF0 are the values that are set to begin with like what you actually change in a tuner program like tuner pro. Then starting at A000 is where the actual program starts:
The "Values" used in TunerPro start at 8000 TO 8F22 (some ALDL items after but the range I listed are the adjustable items for tuning if needed.
Code:
8039  5A	90	9 SEC		WIDE OPEN THROTTLE A/C DISABLE
803A  28	40	4 SEC		WIDE OPEN THROTTLE A/C DISABLE TIME WITH HI N/V
803B  68	104			WIDE OPEN THROTTLE A/C DISABLE N/V RATIO THRESH
803C  00	0			DELTA TPS A/C DISABLE N/V DISABLE THRESHOLD
803D  F6	246			IF TPS > THIS DISABLE A/C
803E  FF	255	99.8 %TPS	IF POSITIVE DELTA TPS > THIS, DISABLE A/C
803F  20	32	3.2 SEC	DISABLE A/C CLUTCH FOR THIS TIME AFTER HIGH POSITIVE DELTA TPS
(remove the leading "8" in TP XDF as it is offset by $8000 in the definition header)
Address(from bin)___HEX Value(from bin)___Conversion value (Someone manually added) ___Decimal value (someone manually made that number)___ Description (Someone manually made that too)
OPEN YOUR XDF AND EDIT THE ITEM TO VERIFY THE ADDRESS SHOWN
You will see how things come together there.

The program execution that uses those variables starts at $A000 (correct)

But are the values that are right after them addresses for other lines to reference?
Looking at the 8F file is a little confusing for you at first.
Let me help you see what is there.

Execution line example:
Code:
A095	LA095:ldaa	*L0016
1.) on the far left is the address that the "Disassembler" has assigned to the location.
As you can see by the beginning of the file, the actual address and the "Lable" of the addressed item are shifted by 1. (Confusion factor)
Code:
 MEMORY LABLES
007E	L007F	=	0x007F				;BLINK ON/OFF PERIOD COUNTER
007F	L0080	=	0x0080				;MALF LOGGING COUNTER
0080	L0081	=	0x0081				;ASYNCHRONOUS PW
0081	L0082	=	0x0082				;INJ PW LSB (ALDL)
0082	L0083	=	0x0083				;O2 SENSOR READY TIMER
Example from Memory usage area of the hac. Here the used locations of memory are declared (so don't use them for anything else)
The "label" should match the location address or the disassembler was told incorrectly where to start. Small error that has to be taken into account mentally. Not important to you yet.

Next we are looking at the execution part of the hac file,

2.) the next item (if there) is a "Label" or NAME of that location in the file.
It is designated by L***:
The colon ends the name.
Usually this is assigned during disassembly by the disassembling program if that location was called by another line in the program. Not all lines have a label assigned.
This is a "hard" jump to point as it is named and will always be the point the program goes to when that "NAME:" is used.

3.) Next is the actual command at that line of programming, STA, BEQ, STR, etc.
Here you need to reference that "Pink Book" to understand exactly what that command does and what type of addressing it is using.
The actual "OP" Code of the command is sometimes shown in disassemblies also.

4.) there is then the value or address to be acted upon by the command.
The "*" was placed by the disassembler to inform that this is a "low" address location that is directly accessed for high speed "possibly"
One of the wonderful things you will discover while tracing OP Codes of similar commands with different addressing uses.

HTH
Jp

Last edited by JP86SS; 05-16-2016 at 11:56 AM.
Old 05-16-2016, 02:15 PM
  #45  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

So for my program for flashing the check engine light the "adjustable" value for the threshold for knock counts can be put here:
Code:
BPW BOOST MULT VS 2BAR MAP INDEX 
8EE4  80     90 KPA
      84      100
      88      110
      8C      120
      90      130
      98      140
      98      150
      98      160
      FF      170
      FF      180
      FF     190

THESE TWO TABLES ARE USED FOR FAN ON/OFF
VS INVERSE CTS2
8EEF  04 06 06 06 08 08
between these two some where (8EE5-8EEE) since that is an extra spot that isn't used? So it would look something like this now?

Code:
LF60B:        ldab *L00A2             ;load knock counts to acumulator b
                 cmpb 8EE5             ;compare knock counts to knock threshold
                 bhi LF613                 ;branch if hi to 
LF613:        bset *L0038,#0x01    ;turn on check engine light    



important locations
L00A2- Knock count threshold
L0038-check engine light output
8EE5-knock count threshold
Old 05-16-2016, 06:45 PM
  #46  
Senior Member
 
UltRoadWarrior9's Avatar
 
Join Date: Mar 2014
Location: NC
Posts: 760
Received 9 Likes on 7 Posts
Car: 1986 IROC Z-28
Engine: 383 Gen I SBC 11:1
Transmission: Rebuilt TH700R4 for 500+HP
Axle/Gears: 4th Gen 10 bolt Eaton Truetrac 3.23
Re: New to source code editing

Originally Posted by camaroyoungster
Ok so those are the actual locations, that really helps out. I wasn't really sure to begin with. So I guess where in the actual part of the code should I put the knock threshold value? It looks like the code is divided up into parts and I really don't know where It would work.

0000-00FF is battery backed static ram.
0100-1FF is non battery back static ram...
Interesting. Those addresses are identical to the 6502 zero page and stack locations, respectively. Since the stack always changes, whether it pulls or pushes, during a program execution, it makes sense that it is not battery backed like that $0000-$00FF Ram block, Usually ZP is used to store important variables, and maybe a cleverly stored small program like a bootstrapper...
Old 05-17-2016, 11:10 AM
  #47  
Supreme Member

iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Re: New to source code editing

Your ideas are good and you should keep pursuing them.
As far as your example goes, it will need more tweaking.

Code:
BPW BOOST MULT VS 2BAR MAP INDEX 
8EE4  80     90 KPA
      84      100 ------ This is 8EE5, can't use that address
      88      110
      8C      120
      90      130
      98      140
      98      150
      98      160
      FF      170
      FF      180
      FF     190
That address is taken, must find open one.

The other thing to look into...
Is there anywhere else in the program that turns the light OFF?
Can't have two places where an output is controlled.

Also, As knock count rises, the light will turn on (if all the new code works)
You will need some kind of decrementing counter or timer to turn the light back off after the knock counts stop increasing.
Knock counts up to 255 then resets to zero. It could stay at a value above the threshold until a reset is done.
Jp
Old 05-17-2016, 11:48 AM
  #48  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Use degrees of retard. If over zero light on.
Old 05-17-2016, 03:23 PM
  #49  
Member

Thread Starter
 
camaroyoungster's Avatar
 
Join Date: Aug 2011
Location: Wisconsin
Posts: 272
Received 1 Like on 1 Post
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

JP86SS, Thank you for that insightful post haha. That makes even more sense now, so one address can't have multiple values so it takes up multiple addresses kind of. Are the addresses starting at 9000 good to use since there are many spaces it looks to be available from 9000 to 9FF0?

The other thing to look into...
Is there anywhere else in the program that turns the light OFF?
Can't have two places where an output is controlled.
Ok so you mean I need to make sure the light is off and if it isn't off turn it off and then turn in back on for however long the knock counts are above a certain threshold?

Here is what I now have for turning the light off and then jumping to turning it on.

Code:
LF60B:        ldab *L00A2        ;load knock counts to acumulator b
        cmpb XXXX        ;compare knock counts to knock threshold
        bhi LF60C        ;branch if hi to 
LF60C:        clrb
        jsr LF60D
LF60D:        bset *L0038,#0x01    ;turn on check engine light
Now I just don't really know how to do an decrementing counter.

Could I possibly make another line of code that if the knock counts is lower than the threshold it will turn the light off?
Old 05-17-2016, 03:31 PM
  #50  
Senior Member

 
Vanilla Ice's Avatar
 
Join Date: Aug 2002
Location: ARIZONA
Posts: 948
Likes: 0
Received 4 Likes on 4 Posts
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by JP86SS
The other thing to look into...
Is there anywhere else in the program that turns the light OFF?
Can't have two places where an output is controlled.
Yes you can as long as you test the light for activity prior and hook it properly. I need to look into this myself soon.

Last edited by Vanilla Ice; 05-17-2016 at 03:42 PM.


Quick Reply: New to source code editing



All times are GMT -5. The time now is 06:12 PM.