Notices
ECU Flash

Disassembly: 2-byte variables

Thread Tools
 
Search this Thread
 
Old Jun 22, 2009, 06:32 PM
  #1  
Evolving Member
Thread Starter
iTrader: (4)
 
Deepnine's Avatar
 
Join Date: Apr 2008
Location: Germany
Posts: 186
Likes: 0
Received 0 Likes on 0 Posts
Disassembly: 2-byte variables

Hi,

i came accross the adc stuff and the 2-byte stuff. I never cared about that before.

i don't know if i had understood it correct:

1.) all memory adresses are 2byte (word) length, but only the 1byte are used like mut_21 (rpm). But there are adresse, which use all 2bytes. Its not a general rule that only the lower 8 bits are used. 2byte values and 1byte values use the same memory space (always a word).

Right?

2.) Lets say i want to log a memory adress which is referenced in the code at 0xFFFF1234 as a word. i know its only a 1byte value in it.
then my mut table must have 0xFFFF1234+1 = 0xFFFF1235

Right?

3.) now i have a two byte value in a word at 0xFFFF6789.
To log it via mut, i need two mut id's. first 0xffff6789 and second 0xFFFF6789+1

Right?


4.) Where is a free memory adress for my stuff? I don't want to overwrite some memory locations, that are used by large arrays or something like that.
Old Jun 22, 2009, 09:24 PM
  #2  
EvoM Guru
iTrader: (50)
 
mrfred's Avatar
 
Join Date: Mar 2006
Location: Tri-Cities, WA // Portland, OR
Posts: 9,675
Received 128 Likes on 96 Posts
Answers are listed in your message.

Hi,

i came accross the adc stuff and the 2-byte stuff. I never cared about that before.

i don't know if i had understood it correct:

1.) all memory adresses are 2byte (word) length, but only the 1byte are used like mut_21 (rpm). But there are adresse, which use all 2bytes. Its not a general rule that only the lower 8 bits are used. 2byte values and 1byte values use the same memory space (always a word).

Right?

--> Yes, except that both 1-byte and 2-byte values are commonly used throughout the code.

2.) Lets say i want to log a memory adress which is referenced in the code at 0xFFFF1234 as a word. i know its only a 1byte value in it.
then my mut table must have 0xFFFF1234+1 = 0xFFFF1235

Right?

--> Correct.

3.) now i have a two byte value in a word at 0xFFFF6789.
To log it via mut, i need two mut id's. first 0xffff6789 and second 0xFFFF6789+1

Right?

--> Correct except that your example address is not aligned. 2-byte values will always end with an even hex value, e.g., 0, 2, 4, ...


4.) Where is a free memory adress for my stuff? I don't want to overwrite some memory locations, that are used by large arrays or something like that.

--> If you set up the memory space in your disassem, you should be able to see what addresses are used. You can use anything that you think is unused. Its important to do some searching in the ROM for references to any address that you are considering using. Mitsu used relatively few indirect calls, but there are some in the code, so its important to try to check all the RAM address stacks in the code to be sure that the address you want so use is not already in-use.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
neuralcj
ECU Flash
5
Jan 7, 2018 02:50 PM
mrfred
ECU Flash
0
Jul 20, 2016 06:02 PM
Kaveeth
ECU Flash
2
Sep 29, 2014 10:59 PM
Danieln
ECU Flash
1
Apr 15, 2010 05:04 AM
hackish
Evo X Engine Management / Tuning Forums
2
Oct 7, 2009 10:31 AM



Quick Reply: Disassembly: 2-byte variables



All times are GMT -7. The time now is 11:03 PM.