Someone can help me

someone can help me transforming this code on c++ to assembley:

void muda_pixeis_c_f3(int altura, int largura, Byte *porig[], Byte *pdest[])
{
// Bin
int x, y, ml, ma, tx, factor;
ml = largura / 2;
ma = altura / 2;
for(y = 0; y < altura; y++){
for(x = 0; x < largura * 3; x+=3){
tx = x / 3;
factor = 1000 - 1000 * ((tx-ml)*(tx-ml) + (y-ma)*(y-ma)) / (ml*ml + ma*ma);
pdest[y][x]= (porig[y][x] * factor) / 1000;
pdest[y][x+1]= (porig[y][x+1] * factor) / 1000;
pdest[y][x+2]= (porig[y][x+2] * factor) / 1000;
}
}
}


i have already start, i only need to someone finish the code

void muda_pixeis_asm_f3(int altura, int largura, Byte *porig[], Byte *pdest[])
{
/*************************************
ebp+20 pdest
ebp+16 porig
ebp+12 largura
ebp+8 altura
ebp-4 x
ebp-8 y

ebp-12 ml
ebp-16 ma
ebp-20 tx
ebp-24 factor
*************************************/

asm
{
sub esp, 24 //int x, y, ml, ma, tx, factor

//declara

Comments

  • What exactally are you trying to accomplish?

    I personally would just disassemble the C routine, and work with that...
    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.mt2002.sitesled.com]Website :: OS Development Series[rightbr][/link][/size]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion