mauriyouth
mauriyouth

Reputation: 61

looking for the equivalent c code of asm

I want to know the corresponding c code of the following asm code, and if you can a explanation of the asm code

PUBLIC fonction2
_tab   DW  0aH DUP (?)
_idx$ = 8               ; size =4
_value$ = 12             ; size =2
fonction2 PROC
         push ebp
         mov ebp, esp

         mov eax, DWORD PTR _idx$[ebp]
         mov cx, WORD PTR _value$[ebp]
         mov word PTR _tab[eax*2], cx

         pop ebp
         ret 0
fonction2 ENDP

What's _idx$ and _value$. Thanks for your help in advance.

Upvotes: 0

Views: 225

Answers (1)

chill
chill

Reputation: 16888

void fonction2 (int idx, short value)
{
   tab [idx] = value;
}

Upvotes: 7

Related Questions