MASM32 Downloads
@HSE: Why 11 "active lines"? It's 8 instructions.
you forget some lines
input before b:eax 11111111111111111111111111111111reversed once b:edx 11111111111111111111111111111111reversed twice b:edx 11111111111111111111111111111111input before b:eax 11110000111100001111000011110000reversed once b:edx 00001111000011110000111100001111reversed twice b:edx 11110000111100001111000011110000input before b:eax 11101110111011101110111011101110reversed once b:edx 01110111011101110111011101110111reversed twice b:edx 11101110111011101110111011101110input before b:eax 11001100110011001100110011001100reversed once b:edx 00110011001100110011001100110011reversed twice b:edx 11001100110011001100110011001100input before b:eax 10101010101010101010101010101010reversed once b:edx 01010101010101010101010101010101reversed twice b:edx 10101010101010101010101010101010input before b:eax 00000000000000000000000000000000reversed once b:edx 00000000000000000000000000000000reversed twice b:edx 00000000000000000000000000000000
without m2m MACRO it could be 7.
mov eax, 0 mov esi, 00100110011110001001100110010101breverse: lzcnt edx, esi bts eax, edx not dl and dl, 1fh btc esi, edx jnz reverse
mov eax, 0 mov esi, 00100110011110001001100110010101breverse: lzcnt ecx, esi bsr edx, esi bts eax, ecx bzhi esi, esi, edx ; requires BMI2 jnz reverse
This is the smallest without using the loop instruction
edx = 00100110011110001001100110010101y, challenge [awch1.asm, 49]eax = 10101001100110010001111001100100y, Nidud (4 active lines, value in edx) [awch1.asm, 56]eax = 10101001100110010001111001100100y, AW (8 active lines, value in esi) [awch1.asm, 70]edx = 10101001100110010001111001100101y, JJ Oops (if wrong no matter active lines, value in eax) [awch1.asm, 83]edx = 10101001100110010001111001100100y, JJ-Nidud (11 active lines, value in eax) [awch1.asm, 101]edx = 10101001100110010001111001100100y, JJ Another (7 active lines, value in eax) [awch1.asm, 114]
mov esi, 26789995h xor edi, edi xor eax, eax mov edx, 1FhL1: bt esi, eax ;setb cl ;test cl, cl jnb @F ; jz @F bts edi, edx@@: ;setb cl ;add eax, 1h inc eax ;sub edx, 1h dec edx jnz L1
why shouldnt a single 1/x with fdiv with double work on reversing bits,as 2 reversed=0.5,4 reversed =0.25,8 reversed=0.125 ...?