pgmfi.org

Hacking up Honda's ECU
It is currently Thu Mar 28, 2024 4:14 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Fri Apr 29, 2005 7:34 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
I don't seem to fully understand how the command MUL/MulB is used in OBD1 P30 code.

The Nx.500 core pdf shows that MulB usually has an object specified after it, but many times throughout my code, I see MUL/MulB all alone...

When MUL/MULB does not have an object to multiply by, what does it do to Accumulator value?


Last edited by Ltdannear on Sat May 14, 2005 11:01 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat May 14, 2005 9:48 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Seems like somewhere I saw a notation in a rom that shows if mulb doesn't have any commands, then:

"MULB"
actually means
"MULB A,R0"
Is this correct?


Last edited by Ltdannear on Sat May 14, 2005 11:03 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat May 14, 2005 11:02 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Also, I wonder if I found a mistake in the NX_800.500 core PDF..

On page J-3:

Quote:
JBR obj.bit,radr

Function
if obj.bit=0 then PC=radr

Description
· This instruction jumps if the bit specified by obj.bit is 0.


but on page J-7...:

Quote:
JBS obj.bit,radr

Function
if obj.bit=0 then PC=radr

Description
· This instruction jumps if the bit specified by obj.bit is 1.


It seems like JBS function is wrong and should read:

if obj.bit=1 then PC=radr

Am I correct???


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat May 14, 2005 11:03 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
In the below code, X1 is set to 0, and then used in addressing...
Code:
                CLR     X1                     ; 39C3 1 208 180 9015             X1 = 0
                L       A, #0ff04h             ; 39C5 1 208 180 6704FF           A = FF04h to A
                ST      A, 00356h[X1]          ; 39C8 1 208 180 D05603           Write A to 0356h+X1(X1=0??)
                ST      A, 0035ah[X1]          ; 39CB 1 208 180 D05A03           Write A to 035Ah+X1(X1=0??)
                ST      A, 0035eh[X1]          ; 39CE 1 208 180 D05E03           Write A to 035Eh+X1(X1=0??)
                LB      A, #0ffh               ; 39D1 0 208 180 77FF             Write FFh to A
                STB     A, 00355h[X1]          ; 39D3 0 208 180 D05503           Write A to 0355h+X1(X1=0??)
                STB     A, 00359h[X1]          ; 39D6 0 208 180 D05903           Write A to 0359h+X1(X1=0??)
                STB     A, 0035dh[X1]          ; 39D9 0 208 180 D05D03           Write A to 035Dh+X1(X1=0??)


In this case, is X1 basically ignored since it is 0? or am I understanding wrong?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu May 19, 2005 5:20 pm 
Offline

Joined: Tue Jul 27, 2004 2:36 am
Posts: 86
Location: Hungary / Europe
1. MUL/MULB without object means the multiplier is A
2. Right, JBR means Jump if Bit Reset (=0) JBS means Jump if Bit Set (=1)
3. X1 is 0, because ST instruction has no direct 16 bit addressing mode


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu May 19, 2005 6:23 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
With MULB you need two values, the multiplier and the value to multiply it by..

Is it A and r0?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 20, 2005 4:08 am 
Offline

Joined: Tue Jul 27, 2004 2:36 am
Posts: 86
Location: Hungary / Europe
The multiplicand always A or AL (MUL or MULB)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 20, 2005 6:58 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
My question is A * ?? = X


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 24, 2005 2:43 am 
Offline

Joined: Tue Jul 27, 2004 2:36 am
Posts: 86
Location: Hungary / Europe
MUL -> A,ER0 = A * A
MULB -> A = AL * AL


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 24, 2005 7:34 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Thank you for making that clear. Sorry for seeming like such a dumas


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jun 25, 2005 3:34 pm 
Offline

Joined: Tue Jul 27, 2004 2:25 am
Posts: 1163
Location: San Francisco CA
hondainfo wrote:
MUL -> A,ER0 = A * A
MULB -> A = AL * AL


huh? um that would be dumb. this is how it works:

MUL = er1A = A*er0;
MULB = A = AL*r0;

Ben


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jun 26, 2005 7:37 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Thanks for clearing that up.. I never fully accepted the previous answer.. it just didn't make sense..


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 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:  
cron
Powered by phpBB® Forum Software © phpBB Group