Pages: [1]
Author Topic: Why the extra step? assembly code  (Read 5129 times)
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« on: July 09, 2014, 12:48:03 PM »

Why is line #4 used instead of moving r5 into 381F0A ?

Code:
calls   0, IRRFilt16bit_32bitRes0_6cae
mov     word_381F1C, r4
mov     word_381F1E, r5
mov     r2, word_381F1E
mov     pvdksf_w_word_381F0A, r2
cmp     r2, pvdkmx_w_word_381F08

vs

Code:
calls   0, IRRFilt16bit_32bitRes0_6cae
mov     word_381F1C, r4
mov     word_381F1E, r5
mov     pvdksf_w_word_381F0A, r5
cmp     r2, pvdkmx_w_word_381F08

Is there a reason for the extra mov and use of r2 ?

Thanks,
Rey
Logged
phila_dot
Hero Member
*****

Karma: +173/-11
Offline Offline

Posts: 1709


« Reply #1 on: July 09, 2014, 01:47:58 PM »

r5 is input and output for that filter IIRC
Logged
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« Reply #2 on: July 09, 2014, 01:58:30 PM »

OK, but why can't it be moved into 381F0A also?
Logged
nyet
Administrator
Hero Member
*****

Karma: +607/-168
Offline Offline

Posts: 12268


WWW
« Reply #3 on: July 09, 2014, 02:13:33 PM »

Code:
calls   0, IRRFilt16bit_32bitRes0_6cae
mov     word_381F1C, r4
mov     word_381F1E, r5
mov     pvdksf_w_word_381F0A, r5
cmp     r2, pvdkmx_w_word_381F08

I assume you mean:

Code:
calls   0, IRRFilt16bit_32bitRes0_6cae
mov     word_381F1C, r4
mov     word_381F1E, r5
mov     pvdksf_w_word_381F0A, r5
cmp     r5, pvdkmx_w_word_381F08

Perhaps a copy is needed in r2? As a return value? Or a future op?
Logged

ME7.1 tuning guide
ECUx Plot
ME7Sum checksum
Trim heatmap tool

Please do not ask me for tunes. I'm here to help people make their own.

Do not PM me technical questions! Please, ask all questions on the forums! Doing so will ensure the next person with the same issue gets the opportunity to learn from your ex
phila_dot
Hero Member
*****

Karma: +173/-11
Offline Offline

Posts: 1709


« Reply #4 on: July 09, 2014, 02:16:19 PM »

No, you're right.

It's an uneccessary step.

Obviously in your example r5 would need to be used for the cmp as well.

There is alot of weird stuff that you will find including obfuscation.
Logged
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« Reply #5 on: July 09, 2014, 02:36:15 PM »

Yes, sorry, I missed that cmp. I thought it was a mov. So, yes, cmp r5, ... Just trying make some space for custom code.

Thanks,
Rey
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.018 seconds with 17 queries. (Pretty URLs adds 0s, 0q)