I tried doing an O(lg2) version, to no avail

Posted by s on Nov. 16, 2008, 11:12 p.m.

power:

enter

mov ecx,[ebp+12]

jcxz GTFOofpowerafterreturningone ;Turns out there's two jump instructions JUST for if CX or ECX==0

mov eax,[ebp+8]

dec ecx

@@:

mul [ebp+8] ;By default, bytes to AL words to AX dwords to EAX

loop @b

return 8

GTFOofpowerafterreturningone:

mov eax,1

return 8

I'm liking this. Nice when learning a new language includes learning a new way of thought

Comments