c - I'm trying to interpret this IA32 assembly language code -
I have this IA32 assembly language code, I am trying to convert to regular c code.
.global FN. Type Fn, @functionfn: pushl% ebp #setup movl $ 1,% eax #setup 1 is in a movl% esp,% ebp #setup movl 8 (% ebp),% edx # pointer x is de sempel $ 1 In,% edx # (* x> 1) Jelly.4 .5: Imul% Adx,% ex subl $ 1,% edx cmpl $ 1,% edx jne.5 .l4: popl% ebp ret
The problem I am facing is deciding which type of comparison is going on. I do not know how the program is in the L5 cache. L5 seems to be because it has a comparison, because there is a comparison between it. I do not even know what is being returned because it seems that most of the work is% of ADX registrations, but does not return to% eax for the return.
What do I have so far:
int fn {}
It seems to me that this is a factual computing, ignoring the manipulation of the stack frame and as such, we leave it with:
< Pre movl $ 1,% eax #setup is in 1a
puts EX in 1
movl 8 (% ebp), % Edx # pointer is in XD
Recovers a parameter in ADX
emul% ADX,% eX
Adiak Multiplies EX by C, the result is inserted into the EX.
subl $ 1,% edx cmpl $ 1,% edx Jne .5
decreases ADX and if edx! Repeats = 1.
In other words, it is almost equivalent:
unsigned facts (unsigned input) {unsigned retal = 1; For (; input! = 1; - input) realval * = input; Return return; }
Comments
Post a Comment