All pastes #293114 Raw Edit

Anonymous

public text v1 · immutable
#293114 ·published 2006-12-27 05:44 UTC
rendered paste body
extern long rough_sqrt(long n);
#pragma aux rough_sqrt =        \
        "bsr  ecx,eax"                  \
        "sub  ecx,15"                   \
        "jle  frac"                             \
        "shr  ecx,1"                    \
        "shr  eax,cl"                   \
        "jmp  done"                             \
        "frac:"                                 \
        "bsr  cx,ax"                    \
        "neg  cx"                               \
        "add  cx,16"                    \
        "shr  cx,1"                             \
        "shl  eax,cl"                   \
        "done:"                                 \
        parm [eax]                              \
        value [eax]                             \
        modify [eax ecx]