pgmfi.org

Hacking up Honda's ECU
It is currently Tue Sep 18, 2018 12:59 pm

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: ASM question, super-noob
PostPosted: Mon Aug 14, 2006 2:58 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
I am working on a project, and have come to something that I cannot figure out.

; This area handles commands we may want to input
; the als will write in the hex for us, we just need to leave room
DW 00000h
DW 00000h
DW 00000h
DW 00000h
DB 000h
MOV A, X1
;SUBB A, #000h
DW 00000h
SJ ign_return

The als writes in the hex for us?? I have no experience in any of this, I am trying to teach myself. In another part of this file, it calls for 00000h twice and 000h three times. How is this done so that one is different from the next. How is it determined which value goes in each place. I do not understand. Feel free to dumb-up your explanation, as I am just learning.

Thanks for your help.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 14, 2006 5:51 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
Maybe??

DW 00000h
DW 00000h
DW 00000h
DW 00000h
DB 000h


There is a list of 5 addresses in the als file
it is these in that order??
00000h is a word? 000h is a byte?
00000h can be used for both??


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 14, 2006 6:22 pm 
Offline

Joined: Sat Jul 31, 2004 3:19 am
Posts: 427
i'v been doing assembly stuff probably longer than you'v been driving and this post makes no sense ot me,
you need to post more info.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 14, 2006 8:10 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
Here is the project


You do not have the required permissions to view the files attached to this post.


Last edited by 8man on Tue Aug 15, 2006 3:20 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 14, 2006 8:11 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
part2


You do not have the required permissions to view the files attached to this post.


Last edited by 8man on Tue Aug 15, 2006 10:48 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 14, 2006 8:14 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
This is a piece of uberdata

The questions I have refer to the end of the asm file where it says
DW 00000h multiple times

I am tryingo make the tps min work


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 15, 2006 2:46 am 
Offline
Senior Developer

Joined: Tue Jul 27, 2004 2:29 am
Posts: 1433
Location: Paramaribo/Suriname
dw 00000 are wrong their. Or the ecu will see them like NOP. but i don't think so.

THe assem sucks real time. I have posted one in the crome dev forum. Which works


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 15, 2006 5:08 am 
Offline

Joined: Fri Sep 17, 2004 10:34 am
Posts: 638
Location: Sofia, Bulgaria
Those instructions simply leave and empty spot in the file.... DW stands for DataWORD... or 2 bytes of data, and the data is 0x0000. If you're making a table for example , you'd do something like this:

org 01234h: ;that's a start address tag
DW 0000 ;some data 2 bytes
DW 1234 ;some data 2 bytes
DB 56 ;some data 1 byte

DB similarly stands for Data BYTE. The data above will apear in the assembled file as 0000123456 starting at address 0x1234 of the file.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 15, 2006 10:36 am 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
so then all those DWs just leave room.

The places in the asm file where it says -- L a, 000h -- these are taken from the list of addresses in the .als file? correct?

I am guessing that they fill in the .asm file in the order that they are listed in the .als file. correct?

I know, the questions are probably childs play. But, I do very much appreciate the help.

One other question. The part for tps min in the asm file says 0d1h is the value to check. I thought that value was supposed to be 0A4h.

I have updated the above two files with the changes that I have made. I am having no luck. Can't seem to see why.

; Check if RPM is below RPM window
L A, #00000h
CMP A, 0C4h
JLT no_n2o

; Check if RPM is above RPM window
L A, #00000h
CMP A, 0C4h
JGT no_n2o

Are these correct. I was under the assumption that JLT means if A<0C4h then jump. JGT means first value is greater, JLT means second is greater, right? The rest of this file makes sense to me now.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 15, 2006 4:01 pm 
Offline

Joined: Tue Jul 27, 2004 2:34 am
Posts: 101
8man wrote:
so then all those DWs just leave room.

The places in the asm file where it says -- L a, 000h -- these are taken from the list of addresses in the .als file? correct?


Yes!

8man wrote:
I am guessing that they fill in the .asm file in the order that they are listed in the .als file. correct?

I know, the questions are probably childs play. But, I do very much appreciate the help.


What I did for the addresses was write the "base" address for the start of the script. Where it says

num n20_RPM_MIN_address = 0x6ac0;
num n20_RPM_MAX_address = n20_RPM_MIN_address + 8;

That means the "start" address for n20_RPM_MIN_address is 0x6ac0, that is a location in the compiled .bin file. That's not the value to write, that's telling it where to write. I figured this out by trial and error, compiling and seeing what wrote what, where. I then counted how many bytes each instruction used and added those as offsets to the "base" addresses. I know there's 8 bytes between where the RPM min and max addresses are needed, so I just used n20_RPM_MIN_address + 8. I could've put it in hex but this makes it easier to move the script around in the .bin.

8man wrote:
One other question. The part for tps min in the asm file says 0d1h is the value to check. I thought that value was supposed to be 0A4h.


I may have been wrong with this but I believe I did test it with the 0d1h for TPS min and it worked. The address is different for different base code. Uber is P72 code, so you have to use P72 addresses.

8man wrote:
I have updated the above two files with the changes that I have made. I am having no luck. Can't seem to see why.

; Check if RPM is below RPM window
L A, #00000h
CMP A, 0C4h
JLT no_n2o

; Check if RPM is above RPM window
L A, #00000h
CMP A, 0C4h
JGT no_n2o

Are these correct. I was under the assumption that JLT means if A<0C4h then jump. JGT means first value is greater, JLT means second is greater, right? The rest of this file makes sense to me now.


This seemed backwards to me too, but it's what worked. I remember there being some weirdo reason for it, like RPM was in a backwards format from what you'd expect.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 15, 2006 4:07 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
Thank you for your replies. VERY helpful. I promise to learn something from it.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 16, 2006 2:43 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
O.k. since I am testing this myself, it gets tested quickly.

Only 1 issue. When the tps portion is made active, idle goes up,down,up,down. Tps min set at 20. Min. speed at 30. So it shouldn't be triggering. Any ideas? I tried it with 0A4h and 0d1h. Thought maybe that was it. nothing :(

The commenting project shows tps at 03A4h, the datalogging file for uberdata says 0A4n. Should I use the 03A4h??


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 16, 2006 8:07 pm 
Offline

Joined: Tue Jul 27, 2004 2:34 am
Posts: 101
I used this page as my resource:

http://www.pgmfi.org/twiki/bin/view/Library/P72


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 16, 2006 9:12 pm 
Offline

Joined: Sun Sep 11, 2005 11:41 am
Posts: 132
Location: missouri
D1 - from the wiki thanks raene
I didn't realize where the info was coming from. (ram)

Any ideas on the crazy idle??
I will test it again. Idle fixed.

Not working though. 0D1h is calculated how. I have datalogging formulas only. serial15 sreply=(sreply * 100) / 255 This is how I am calculating for my TPS min address. TPS at WOT, min set at 50, still no trigger.??!!

calvin: This is from the crome script
tpsmin = (0.46729 * Rom.byteAt(0x79bf) - 10.7477).toFixed(0);
Is this what you mean? Would this also work for uberdata? What is this compared to? 0D1h? I do not understand the .toFixed(0)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Aug 17, 2006 1:12 pm 
Offline

Joined: Tue Jul 27, 2004 2:34 am
Posts: 101
.ToFixed(0) returns a string representing a number in fixed-point notation.

The zero denotes you want zero decimal places.

0d1h isn't calculated, it's assigned to each program cycle, and you check it.

I'm sorry, I don't understand the rest of what you're asking...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB® Forum Software © phpBB Group